0

I use the below code to open data-roaming setting page

f(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);
            startActivityForResult(intent,10);
        }
        else
        {
            Intent intent = new Intent();
            intent.setAction(android.provider.Settings.ACTION_DATA_ROAMING_SETTINGS);
            startActivityForResult(intent,10);
        }   

and it works fine on the most of the device.but on some devices it opens the settings page but data roaming option is not available in that page.

Makoto
  • 104,088
  • 27
  • 192
  • 230
User10001
  • 1,295
  • 2
  • 18
  • 30
  • The settings application keeps on changing according to the devices and the android OS so it can be possible that in some devices you will not the option all the time correctly it can be shifted on wifi section also. – GrIsHu Jan 21 '14 at 07:04
  • Any help how to handle this all this. – User10001 Jan 21 '14 at 07:20
  • In which devices you are facing issue? – GrIsHu Jan 21 '14 at 07:22
  • Gionee E3 and LenovoA8000 – User10001 Jan 21 '14 at 07:30
  • possible duplicate of [Wrong settings pages are opened by the device when I fire the system intent](http://stackoverflow.com/questions/21480845/wrong-settings-pages-are-opened-by-the-device-when-i-fire-the-system-intent) – Makoto Mar 30 '14 at 16:44
  • this must be happening for those samsung devices – SMR Feb 26 '15 at 07:37

1 Answers1

1

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 using android 4.1.2

SMR
  • 6,628
  • 2
  • 35
  • 56
  • This intent forwards your app to roaming settings and data, but i if would like to go to Data Usage, how i achieve that? – AXSM Feb 25 '15 at 23:21
  • @AlexSanchez this scenario is different from this one. ask a different question and provide me the link – SMR Feb 26 '15 at 08:17
  • @AlexSanchez may be [ACTION_USAGE_ACCESS_SETTINGS](http://developer.android.com/reference/android/provider/Settings.html#ACTION_USAGE_ACCESS_SETTINGS) is what you are looking for :) – SMR Feb 26 '15 at 09:24
  • I dont think so. dude :-| – AXSM Mar 06 '15 at 16:06