开发者

How to direct users to my android app store

开发者 https://www.devze.com 2023-03-31 12:43 出处:网络
I know this question has been asked and answered before. But when I try the following code: Intent intent = new Intent(Intent.ACTION_VIEW);

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 开发者_StackOverflowbe I need to import something? I have imported android.net.URI


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消