Enable USB Tethering Android Programmatically with

2019-06-08 16:36发布

I am developing an application that requires USB Tethering.

I am using the following code to do so

Intent tetherSettings = new Intent();
        tetherSettings.setClassName("com.android.settings", "com.android.settings.TetherSettings");
        startActivity(tetherSettings);

But this code is opening the Tethering Setting so the user can Enable the USB tethering by clicking on it. Is it possible to enable the tethering without any user interaction?

1条回答
戒情不戒烟
2楼-- · 2019-06-08 17:11

No, Android is very security-aware and will not enable this setting without user interaction.

查看更多
登录 后发表回答