How to redirect user to Ethernet Settings screen in android programmatically?

霸气de小男生 提交于 2019-12-11 17:13:35

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!