I'm working on an app that i have already published in the App Store, now making an Android build. In the iOS i simply use an uri like this one:
instagram://tag?name=myHashtag
It opens Instagram app, showing a grid of photos corelated with the hashtag. Unfortunately, in the android, below code doesn't work:
Intent hashtagIntent = new Intent(Intent.ACTION_VIEW,
Uri.parse("instagram://tag?name=myHashtag")
);
startActivity(hashtagIntent);
Is there any method that would make this work? It's not any core feature of the app, so i don't want use Instagram's API.
I worked a bit with instagram before and what I figured out is how to open certain pic or profile in app. But as long as there is no link on the instagram website for hashtags I don't know how to totally help you. In any case, this is how you open a pic on Instagram app from another app:
Intent insta_intent = getPackageManager().getLaunchIntentForPackage("com.instagram.android");
insta_intent.setComponent(new ComponentName("com.instagram.android", "com.instagram.android.activity.UrlHandlerActivity"));
insta_intent.setData(Uri.parse("http://instagram.com/p/gjfLqSBQTJ/"));
startActivity(insta_intent);
Change the link for http://instagram.com/_u/USER
to open a user's profile.
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With