4

here is my ex code

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);
    }
});
}

i want when i click on web button to open this ex application with Samsung store as direct link, not with the browser .

  • When you asked Samsung how to do this, through [Samsung's developer support site](http://developer.samsung.com/forum/en), what did they tell you? – CommonsWare Jan 11 '14 at 15:44
  • Duplicate at http://stackoverflow.com/questions/20798234/can-i-rederect-user-to-samsung-app-store-from-my-android-app – Graham.Fraser Jan 11 '14 at 16:35

2 Answers2

6

Create the Intent like this:

@Override
public void onClick(View v) {
    val intent = Intent(Intent.ACTION_VIEW, Uri.parse("samsungapps://ProductDetail/com.example.hi"))
    startActivity(intent)
}
Georgios
  • 4,764
  • 35
  • 48
user3193413
  • 575
  • 7
  • 10
0

Use this code for open app detail page in Galaxy Store:

Uri uri = Uri.parse( "https://galaxystore.samsung.com/detail/"+getPackageName() );
startActivity( new Intent( Intent.ACTION_VIEW, uri ) );
Style-7
  • 985
  • 12
  • 27