简体   繁体   中英

Instagram custom URL scheme for Android

I need to run the Instagram Application, using the HTML link. For iPhone I use iPhone Hooks( Instagram iPhone Hooks ).

How can I do the same for Android?

There's a thread on this subject in the Instagram API Developers group on Google Groups.

According to Mike Krieger, who is one of the Instagram developers, you can already achieve Document Interaction on Android using Intents. If that is what you need, you should look at the Android document on sharing with intents .

The basic code for sharing an image (which should popup Instagram as one of your sharing options) would look like this:

Intent intent = new Intent(Intent.ACTION_SEND);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
intent.setType("image/*");
Uri uri = Uri.fromFile(getFileStreamPath(pathToImage));
intent.putExtra(Intent.EXTRA_STREAM, uri);
startActivity(Intent.createChooser(intent, "How do you want to share?"));

pathToImage is obviously the filename of the image you want to share.

Unfortunately there doesn't appear to be support for any of the custom URL functionality at this point. So if that is what you're after, I would suggest you provide feedback in that Google Groups thread saying specifically which functionality you need.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM