Instagram custom URL scheme for Android

社会主义新天地 提交于 2020-01-13 02:43:09

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/15063868/instagram-custom-url-scheme-for-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!