如何在应用程序中打开samsungapps商店的链接

问题描述 投票:1回答:1

这是我的前密码

public class MainActivity extends Activity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

Button web = (Button) findViewById(R.id.button1);

web.setOnClickListener(new View.OnClickListener() {

    @Override
    public void onClick(View v) {
        Intent intent = new Intent(); 
        // set data 
        intent.setData(Uri.parse("http://apps.samsung.com/mars/appquery/appDetail.as?appId=com.example.hi")); 

        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_INCLUDE_STOPPED_PACKAGES);

        startActivity(intent);
    }
});
}

我想在我单击Web按钮时以三星商店作为直接链接而不是浏览器来打开此ex应用程序。

android android-intent app-store samsung-mobile
1个回答
0
投票
 val intent = Intent(Intent.ACTION_VIEW, Uri.parse("samsungapps://ProductDetail/com.example.hi"))
    startActivity(intent)
© www.soinside.com 2019 - 2024. All rights reserved.