In my app i want to navigate user to settings where he/she able to activate device mobile data.
I want to use intent to solve this but my problem is that mobile data option is in different pages in device settings for Exmaple below code work fine in Sony Xperia Z2 device (with android 5.1.1)
startActivity(new Intent(Settings.ACTION_WIRELESS_SETTINGS));
But in some other device such as sony experia SP (android 4.3) and samsung S4 (android 5.0.1) user must choose one more step and go to mobile network page. I can resolve this problem with this code : (Going straight to mobile network)
Intent intent=new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS);
ComponentName cn = new ComponentName("com.android.phone","com.android.phone.Settings");
intent.setComponent(cn);
startActivity(intent);
But user with z2 must return one step back ! How can i resolve this ? choose which way ? (I hope explain problem clear )