Android - Mobile network settings menu (Jelly Bean)

后端 未结 2 2220
盖世英雄少女心
盖世英雄少女心 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:24

    The code below is much more simple and tested on Gingerbread (2.3.7) and JB (4.1.2)

        startActivityForResult(new Intent(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS), 0);
    
    0 讨论(0)
  • 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);
    
    0 讨论(0)
提交回复
热议问题