1. 监听飞行模式,来更新显示STK,飞行模式下不可用
<receiver android:name="com.android.stk.BootCompletedReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.AIRPLANE_MODE" />
<action android:name="android.intent.action.SIM_STATE_CHANGED" />
</intent-filter>
</receiver>
2. 查询飞行模式状态,来确定是否显示STK应用
boolean isCardExist = PhoneFactory.isCardExist(0);
if (isCardExist) {
boolean isAirplaneModeOn = Settings.System.getInt(context.getContentResolver(),
Settings.System.AIRPLANE_MODE_ON, 0) != 0;
if(isAirplaneModeOn){
StkAppInstaller.unInstall(context);
}else{
StkAppInstaller.install(context);
}
}
<receiver android:name="com.android.stk.BootCompletedReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.AIRPLANE_MODE" />
<action android:name="android.intent.action.SIM_STATE_CHANGED" />
</intent-filter>
</receiver>
2. 查询飞行模式状态,来确定是否显示STK应用
boolean isCardExist = PhoneFactory.isCardExist(0);
if (isCardExist) {
boolean isAirplaneModeOn = Settings.System.getInt(context.getContentResolver(),
Settings.System.AIRPLANE_MODE_ON, 0) != 0;
if(isAirplaneModeOn){
StkAppInstaller.unInstall(context);
}else{
StkAppInstaller.install(context);
}
}