Open menu of the Sim tool kit

4.7k Views Asked by At

I want my app to open sim card toolkit so that a user can make payments via mobile provided in the sim toolkit application Please help

2

There are 2 best solutions below

1
On

Something like this will launch it on some devices:

Intent simToolKitLaunchIntent = getContext().getPackageManager().getLaunchIntentForPackage("com.android.stk");
if(simToolKitLaunchIntent != null) {
    startActivity(simToolKitLaunchIntent);
}
1
On
 button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent intent = getApplicationContext().getPackageManager().getLaunchIntentForPackage("com.android.stk");
            if (intent != null){
                startActivity(intent);
            }else {
                Toast.makeText(getApplicationContext(),"NO SIM CARD FOUND",Toast.LENGTH_LONG).show();
            }
          
        }
    });