mirror of
https://github.com/ZCShou/GoGoGo.git
synced 2026-06-05 21:00:50 +08:00
feat: add some tips for develop
This commit is contained in:
parent
d38d022742
commit
1f4763300a
@ -420,11 +420,15 @@ public class MainActivity extends BaseActivity implements SensorEventListener {
|
||||
Intent intent = new Intent(MainActivity.this, SettingsActivity.class);
|
||||
startActivity(intent);
|
||||
} else if (id == R.id.nav_dev) {
|
||||
try {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS);
|
||||
startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
if (!GoUtils.isDeveloperOptionsEnabled(this)) {
|
||||
GoUtils.DisplayToast(this, getResources().getString(R.string.app_error_dev));
|
||||
} else {
|
||||
try {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS);
|
||||
startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
GoUtils.DisplayToast(this, getResources().getString(R.string.app_error_dev));
|
||||
}
|
||||
}
|
||||
} else if (id == R.id.nav_update) {
|
||||
checkUpdateVersion(true);
|
||||
|
||||
@ -28,6 +28,14 @@ import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class GoUtils {
|
||||
public static boolean isDeveloperOptionsEnabled(Context context) {
|
||||
return Settings.Global.getInt(
|
||||
context.getContentResolver(),
|
||||
Settings.Global.DEVELOPMENT_SETTINGS_ENABLED,
|
||||
0
|
||||
) == 1;
|
||||
}
|
||||
|
||||
// WIFI是否可用
|
||||
public static boolean isWifiConnected(Context context) {
|
||||
// 从 API 29 开始,NetworkInfo 被标记为过时,这里更换新方法
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
<string name="app_error_input_null">输入不能为空,请重新输入内容</string>
|
||||
<string name="app_error_search">查找失败,请检查网络或定位</string>
|
||||
<string name="app_error_location">请先选择位置</string>
|
||||
<string name="app_error_dev">无法跳转到开发者选项,请先确保已开启开发者模式</string>
|
||||
<string name="app_error_dev">开发者模式未开启,无法跳转!请自行搜索开启方法</string>
|
||||
<string name="app_error_param">非法参数</string>
|
||||
<string name="app_error_protocol">请先阅读并接收用户协议</string>
|
||||
<string name="app_error_username">用户名不合法</string>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user