File tree Expand file tree Collapse file tree
dConnectDevicePlugin/dConnectDeviceTheta/app/src/main
java/org/deviceconnect/android/deviceplugin/theta/fragment Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import android .content .Intent ;
55import android .net .wifi .ScanResult ;
66import android .os .Build ;
7+ import android .provider .Settings ;
78
9+ import org .deviceconnect .android .deviceplugin .theta .R ;
810import org .deviceconnect .android .deviceplugin .theta .ThetaDeviceService ;
911
1012@ TargetApi (Build .VERSION_CODES .Q )
@@ -21,8 +23,17 @@ protected void connectWifi(final ScanResult result) {
2123 @ Override
2224 protected void onWifiDisabled () {
2325 mLogger .info ("ConfirmationFragmentForApi29.onWifiDisabled" );
24- // TODO API レベル 29 以降は Wi-Fi の ON/OFF をアプリで制御不能になったため、端末標準の設定画面へ誘導
26+ // API レベル 29 以降は Wi-Fi の ON/OFF をアプリで制御不能になったため、端末標準の設定画面へ誘導
27+ ThetaDialogFragment .showConfirmAlert (getActivity (),
28+ getString (R .string .wifi_setting ),
29+ getString (R .string .wifi_setting_prompt ),
30+ getString (R .string .open_wifi_setting ),
31+ (dialog , which ) -> openWifiSetting ());
2532 }
2633
34+ private void openWifiSetting () {
35+ Intent intent = new Intent (Settings .ACTION_WIFI_SETTINGS );
36+ startActivity (intent );
37+ }
2738
2839}
Original file line number Diff line number Diff line change 4848 <string name =" communication_error" >通信エラー</string >
4949 <string name =" theta_app" >アプリ</string >
5050 <string name =" theta_data_import" >THETAのデータを取り込みました。</string >
51+ <string name =" open_wifi_setting" >設定を開く</string >
52+ <string name =" wifi_setting_prompt" >Wi-Fi が OFF になっています。\nWi-Fi 設定画面で ON にしてください。</string >
53+ <string name =" wifi_setting" >Wi-Fi 設定</string >
5154
5255 <string-array name =" theta_gallery_command" >
5356 <item >取り込み</item >
Original file line number Diff line number Diff line change 4848 <string name =" communication_error" >Communication error</string >
4949 <string name =" theta_app" >Application</string >
5050 <string name =" theta_data_import" >Imported the data of THETA.</string >
51+ <string name =" open_wifi_setting" >Open</string >
52+ <string name =" wifi_setting_prompt" >Wi-Fi feature is turned off.\Open Wi-Fi setting, and turn Wi-Fi on.</string >
53+ <string name =" wifi_setting" >Wi-Fi Setting</string >
5154
5255 <string-array name =" theta_gallery_command" >
5356 <item >Import</item >
You can’t perform that action at this time.
0 commit comments