| | |
| | | import androidx.fragment.app.FragmentTransaction; |
| | | |
| | | import android.Manifest; |
| | | import android.app.Activity; |
| | | import android.content.Context; |
| | | import android.content.Intent; |
| | | import android.content.pm.PackageManager; |
| | |
| | | @Override |
| | | public void onBindView(Bundle savedInstanceState) { |
| | | setStatusBarTranslucent(); |
| | | getWindow().setNavigationBarColor(getColor(R.color.text_FF333738)); |
| | | |
| | | getWindow().setNavigationBarColor(getColor(R.color.text_FF1C1C1E)); |
| | | //初始化碎片 |
| | | initFragment(savedInstanceState); |
| | | //初始化 |
| | |
| | | this.notificationSet(); |
| | | //ACCESS_FINE_LOCATION 允许使用GPS定位 |
| | | //ACCESS_COARSE_LOCATION 允许使用WIFI热点或基站来获取粗略的定位 |
| | | String[] ary = PermissionUtils.checkPermission(_mActivity, new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}); |
| | | if (ary.length > 0) { |
| | | this.requestPermissions(ary, PermissionUtils.STATUS_SUCCESS); |
| | | } else { |
| | | locationUpdates(); |
| | | } |
| | | // String[] ary = PermissionUtils.checkPermission(_mActivity, new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION}); |
| | | // if (ary.length > 0) { |
| | | // this.requestPermissions(ary, PermissionUtils.STATUS_SUCCESS); |
| | | // } else { |
| | | // locationUpdates(); |
| | | // } |
| | | } |
| | | |
| | | @Override |
| | |
| | | @Override |
| | | public void onMessage(Object msg) { |
| | | |
| | | |
| | | if (msg == null) { |
| | | return; |
| | | } |