Basically, I am looking to open an Instagram application from another application and send a caption image. IOS has some useful documentation. ( iPhone-hooks )
Does Instagram support custom actions on Android, like iOS, as described in iPhone hooks ?
Below is the current code used in my application to perform this task partially.
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); } }
None of the above title, description, signature 01, signature 02, signature 03 does not work.
Then I tried using
shareIntent.setAction(Intent.ACTION_SEND); β shareIntent.setAction(Intent.ACTION_SEND_MULTIPLE);
and
shareIntent.setType("image/jpeg"); shareIntent.setType("image/*"); shareIntent.setType("*/*");
too, but none of the above work.
source share