以编程方式启用USB网络共享Android,无需用户交互 [英] Enable USB Tethering Android Programmatically without user Interaction

查看:1034
本文介绍了以编程方式启用USB网络共享Android,无需用户交互的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发需要USB网络共享的应用程序.

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);

但是此代码正在打开网络共享设置",因此用户可以通过单击来启用USB网络共享.是否可以在没有任何用户交互的情况下启用网络共享?

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?

推荐答案

否,Android非常安全,因此在没有用户交互的情况下不会启用此设置.

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

这篇关于以编程方式启用USB网络共享Android,无需用户交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆