Steblo
Steblo

Reputation: 625

How to direct users to my android app store

I know this question has been asked and answered before. But when I try the following code:

Intent intent = new Intent(Intent.ACTION_VIEW); 
intent.setData(Uri.parse("market://details?id=your.game.package.name")); 
startActivity(intent); 

I get the message "the method parse(String) is undefined for the type String.

Could it be I need to import something? I have imported android.net.URI

Upvotes: 0

Views: 102

Answers (1)

Salw
Salw

Reputation: 1900

Works for me. You have to import android.net.Uri. CamelCase.

EDIT: If I added String Uri = null; above your snippet I got exactly same error as you have.

Upvotes: 1

Related Questions