Search code examples
androidandroid-intentgoogle-playsamsung-mobile

SamsungApps start Intent


Actually I want some advice, how to start SamsungApps application from my android application and automatically redirect to my seller account. For example, when I want to start Market app, I just start Intent with "market://...." URI. Is there some similar mechanism to start SamsungApps? Or how at least start a browser with my seller account page? Thank you for your attention.


Solution

  • So, I googled a little better and found this snippet. Works for me.

    Intent intent = new Intent();
    
    // set data
    intent.setData(Uri.parse(string_of_uri)); // The string_of_uri is a String object including a URI such as "samsungapps://ProductDetail/{the package name of the AndroidManifest.xml file in your application}".
    
    // add flags
    intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
    // The Intent.FLAG_INCLUDE_STOPPED_PACKAGES flag must only be added if the API level of your Android SDK is above 11 like Honeycomb.
    
    startActivity(intent);