Recep Kara Recep Kara -4 years ago 199
Android Question

Android Studio open intent and data input

I open the settings using intent on Android studio. I would like to enter data in a part of these settings that are opened later. How can I do that?
I am sorry for my English. Google Translate

UPDATE:

enter image description here

After the object is submitted, the empty space (names, type, etc.) in the images must be filled

Answer Source

You can use this to achieve the above !! I tested this on Kitkat and lollipop devices , On both of them its working

 Intent intent = new Intent();
intent.setComponent(new ComponentName("com.android.settings","com.android.settings.Settings$DataUsageSummaryActivity"));
startActivity(intent);

UPDATE

public static void showDataRoamingScreen()
 {
if(Build.VERSION.SDK_INT > 15)
{
    _showSettingScreen("android.settings.DATA_ROAMING_SETTINGS");
}
else
{
    Intent intent=new Intent(Settings.ACTION_DATA_ROAMING_SETTINGS);
    ComponentName cName = new ComponentName("com.android.phone","com.android.phone.Settings");
    intent.setComponent(cName);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    Reference.getAppContext().startActivity(intent);
}
}



 public static void showDataMobileScreen()
 {
if(Build.VERSION.SDK_INT > 15)
{
    Intent intent = new Intent(Settings.ACTION_WIRELESS_SETTINGS);//android.provider.Settings.ACTION_SETTINGS //Intent.ACTION_MAIN
    intent.setClassName("com.android.settings", "com.android.settings.Settings$DataUsageSummaryActivity");
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    Reference.getAppContext().startActivity(intent);
}
else
{
    showDataRoamingScreen();
}
}


protected static void _showSettingScreen(String intentStr)
{
try
{
    Intent intent = new Intent(intentStr);
    intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    Reference.getAppContext().startActivity(intent);
}
catch (Exception e) {Reference.showToast(e.toString(), true);}
}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download