错误的设置页面由设备打开时我火了系统的意图 [英] Wrong settings pages are opened by the device when I fire the system intent

查看:159
本文介绍了错误的设置页面由设备打开时我火了系统的意图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我火了系统的意图,在Android设备中打开了错误的设置页面。我试图用低于code。打开数据漫游设置页面,但该设备打开设置页面中数据漫游选项并不present。

 如果(BV< Build.VERSION_ codeS.JELLY_BEAN){
    意向意图=新意图(Settings.ACTION_DATA_ROAMING_SETTINGS);
    组件名CNAME =新的组件名(com.android.phone,com.android.phone.Settings);
    intent.setComponent(CNAME);
    startActivity(意向);
}其他{
    意向意图=新的Intent();
    intent.setAction(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS);
    startActivity(意向);
}


解决方案

试试这个

 意向意图=新的Intent();
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS);
startActivity(意向);

它的工作在我的情况。这件事情的是Android 4.1.2为我工作

When I fire the system intent, the Android device opens the wrong settings page. I tried to open the Data Roaming setting page with the below code, but the device opened the settings page in which data roaming option is not present.

if (bv < Build.VERSION_CODES.JELLY_BEAN) {
    Intent intent = new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS);
    ComponentName cName = new ComponentName("com.android.phone", "com.android.phone.Settings");
    intent.setComponent(cName);
    startActivity(intent);
} else {
    Intent intent = new Intent();
    intent.setAction(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS);
    startActivity(intent);
}

解决方案

Try this

Intent intent = new Intent();
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS);
startActivity(intent);

It's working in my case. This thing is working for me in android 4.1.2

这篇关于错误的设置页面由设备打开时我火了系统的意图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆