android developer android developer - 6 months ago 48
Android Question

How to open VKontakte app with a specific friend?

Background



In order to open Facebook app with a specific Facebook friend, you can use this intent:

final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format("fb://profile/%s", friendId)));


A similar solution is found for LinkedIn:

final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format("linkedin://profile/%s", friendId)));


I think the next one will work for Google Plus (didn't test it, but it seems promising) :

final Intent intent =new Intent(Intent.ACTION_VIEW, Uri.parse(String.format("https://plus.google.com/%s/posts", friendId)));


The question



I've tried to find how to open VKontakte (VK) social network app using such intents, but couldn't find it.

Is there such an intent? If so, what is it?

Answer

The answer from developer is next:

Yes, it's done the same way:

final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(String.format("vkontakte://profile/%d", friendId)));

If you need to open a community, use the same URL but add the minus sign to the community ID.

Question answered here

Comments