Parker Sellers 5 days ago

How to link to from one Android app to another?

Google has a nice page here showing how to do this: https://developer.android.com/distribute/tools/promote/linking.html

Basically, use this code, and it will open the Play Store to the new apps page:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("market://details?id=com.example.android"));
startActivity(intent);

When I try this however, I get the error:

 Cannot resolve the symbol 'Uri'

What am I missing? I'm sure its extremely simple, perhaps something I need to import.

Answers


W4R10CK 5 days ago

Use a proper format:

Intent intent = new Intent(Intent.ACTION_VIEW);
Uri.parse("market://details?id=com.example.android"));
startActivity(intent);

Post Status

Asked in 5 days ago
Viewed 1,761 times
Voted 13
Answered 1 times

Search




Leave an answer