Programatically launch phone internal setting dialog on Android phone

621 Views Asked by At

I have an philips w626 dual-sim android 2.3.5 phone.

When I manually turn on data connection, SIM selection dialog appears and I have to choose what Card should data be switched on. And exaclty this Dialog I want launch programatically, for example using some Tasker plugin when I start an application which needs data connection.

Phone is rooted, I can use adb shell, logcat,

Thank You.

1

There are 1 best solutions below

1
Usman Kurd On

Use the following Snippet

    int adb = Settings.Secure.getInt(context.getContentResolver(),
  Settings.Secure.ADB_ENABLED, 0);
 // toggle the USB debugging setting
 adb = adb == 0 ? 1 : 0;
 Settings.Secure.putInt(context.getContentResolver(), 
Settings.Secure.ADB_ENABLED, adb);

add these permissions

 <uses-permission android:name="android.permission.WRITE_SETTINGS"></uses-permission>

<uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"></uses-permission>

for further Help have a look at the following Link