我基本上找送的圖像從另一個應用中打開Instagram的應用程序,並用字幕發送圖像。 在iOS中有一些有用的文檔可以做到這一點。 (iPhone-hooks)打開Instagram的應用程序,並用字幕
是否支持Instagram在iOS中執行自定義操作,如iPhone-hooks中所述?
下面是我的應用程序用於部分執行該任務當前的代碼。
private void sendImageToIntagram(Activity activity) {
Intent intent = activity.getPackageManager().getLaunchIntentForPackage("com.instagram.android");
if (intent != null) {
Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.setPackage("com.instagram.android");
String imagePath = ImageUtil.getProcessedImage().getAbsolutePath();
try {
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(MediaStore.Images.Media.insertImage(activity.getContentResolver(), imagePath, "Title", "Description")));
// shareIntent.putExtra(Intent.EXTRA_TITLE, "Caption 01");
// shareIntent.putExtra(Intent.EXTRA_TEXT, "Caption 02");
// shareIntent.putExtra(Intent.EXTRA_SUBJECT,"Caption 03");
} catch (FileNotFoundException e) {
e.printStackTrace();
}
shareIntent.setType("image/jpeg");
activity.startActivity(shareIntent);
} else {
// bring user to the market to download the app.
intent = new Intent(Intent.ACTION_VIEW);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setData(Uri.parse("market://details?id=" + "com.instagram.android"));
activity.startActivity(intent);
}
}
以上都沒有標題,說明,標題01,標題02,標題03起作用。
然後我用,
shareIntent.setAction(Intent.ACTION_SEND);
嘗試 - >shareIntent.setAction(Intent.ACTION_SEND_MULTIPLE);
,並
shareIntent.setType("image/jpeg");
shareIntent.setType("image/*");
shareIntent.setType("*/*");
過,但沒有上述還曾。