Android中是否存在与instagram://camera
相同的内容,如iOS中一样?
答案 0 :(得分:1)
不,因为我知道没有相同的东西,但你可以将照片(或视频,只需更改一点)直接发布到Instagram发布对话框:
public void postInstagramPhoto(File photo, String message, OnPostingCompleteListener onPostingCompleteListener) {
String instagramPackage = "com.instagram.android";
String errorMessage = "You should install Instagram app first";
if(isPackageInstalled(instagramPackage, getActivity())){
Intent normalIntent = new Intent(Intent.ACTION_SEND);
normalIntent.setType("image/*");
normalIntent.setPackage(instagramPackage);
File media = new File(photo.getAbsolutePath());
Uri uri = Uri.fromFile(media);
normalIntent.putExtra(Intent.EXTRA_STREAM, uri);
normalIntent.putExtra(Intent.EXTRA_TEXT, message);
getActivity().startActivity(normalIntent);
} else {
Toast.makeText(getActivity(), "Install Instagram first.", Toast.LENGHT_SHORT).show();
}
}
您可以查看asne-instagram here
中的其他常用方法或者如果您需要添加更多社交网络check this