问题
i have some scenarios in which i need to redirect user to some settings in device(rooted device).example i am redirecting user to wifi settings page like below
Intent intent = new Intent(Settings.ACTION_WIFI_IP_SETTINGS);
intent.putExtra("extra_prefs_show_button_bar", true);
startActivity(intent);
same way i need to redirect user to ethernet settings page i am including screen shot of that page because some phones not containing ethernet settings some of may not aware.
回答1:
I am aware the syntax is Settings.ACTION_ETHERNET_IP_SETTINGS . Make sure it is not null or it will crash. Please refer to TV network package Source code for example
回答2:
I just read your help sign. My device was embedded target so I could revise almost all source code and there was only one target cause it was embedded!
If you use standard Android API even it is rooted, you would better implement your custom setting page for ethernet(Copying original ethernet setting source and modifying it may be better) because some devices does not own ehternet setting activity.
And.. I quit Android developing since then. So I don't know recent developing Android.
回答3:
Intent intent = new Intent("android.settings.ETHERNET_SETTINGS");
startActivity(intent);
Success on Android 6.0.1 Devices
来源:https://stackoverflow.com/questions/51981852/how-to-redirect-user-to-ethernet-settings-screen-in-android-programmatically