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 .
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)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With