我希望我的应用程序打开sim卡工具包,以便用户可以通过sim卡工具包应用程序提供的移动设备进行支付请帮助
类似这样的代码将在某些设备上启动它:
Intent simToolKitLaunchIntent = getContext().getPackageManager().getLaunchIntentForPackage("com.android.stk");
if(simToolKitLaunchIntent != null) {
startActivity(simToolKitLaunchIntent);
}
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();
}
}
});