Android - Mobile network settings menu (Jelly Bean)

后端 未结 2 2227
盖世英雄少女心
盖世英雄少女心 2021-02-15 17:46

following code is not working for Jelly Bean (Android 4.1):

final ComponentName cn = new ComponentName(\"com.android.phone\",\"com.android.phone.Settings\");
fin         


        
2条回答
  •  忘了有多久
    2021-02-15 18:36

    try as:

    final  Intent intent=new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS);
    intent.addCategory(Intent.CATEGORY_LAUNCHER);
     final ComponentName cn = new ComponentName("com.android.phone","com.android.phone.Settings");
    intent.setComponent(cn);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    startActivity(intent);
    

提交回复
热议问题