![](/img/trans.png)
[英]How to enable USB tethering in android programmatically or guiding user to do that
[英]Enable USB Tethering Android Programmatically without user Interaction
我正在開發需要USB網絡共享的應用程序。
我正在使用以下代碼來做到這一點
Intent tetherSettings = new Intent();
tetherSettings.setClassName("com.android.settings", "com.android.settings.TetherSettings");
startActivity(tetherSettings);
但是此代碼打開了“網絡共享設置”,因此用戶可以通過單擊它來啟用USB網絡共享。 是否可以在沒有任何用戶交互的情況下啟用網絡共享?
不可以,Android非常了解安全性,並且在沒有用戶交互的情況下不會啟用此設置。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.