簡體   English   中英

在Android 4.0、4.1、4.2上,如何以編程方式打開android Ap或通過代碼轉到“設置”->“更多...->便攜式Wi-Fi熱點”?

[英]On Android 4.0, 4.1, 4.2, how to open android Ap progmatically or Go to Settings->More…->Portable Wi-Fi hotspot by code?

唯一可能的解決方案是:

    Intent intent = new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS); 
    //Is there any value for entering hotsopt?

    mContext.startActivity(intent);

你有沒有嘗試過:

startActivity(new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS));

請注意( ACTION_WIRELESS_SETTINGS 文檔 ):

動作:顯示設置以允許配置無線控件,例如Wi-Fi,藍牙和移動網絡。

在某些情況下,可能不存在匹配的活動,因此請確保對此加以防范。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM