陈奇
2019-05-29 c5bf501d8b507d1e3e79541e7ac9b45910860b4d
app/src/main/java/com/moral/yunfushao/activity/BLESearchActivity.java
@@ -68,8 +68,11 @@
    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (mBluetoothService != null)
        if (mBluetoothService != null) {
            mBluetoothService.cancelScan();
            unbindService();
        }
        EventMessage msg = new EventMessage();
        msg.setType(AppConfig.SET_MAIN_CALL);
        EventBus.getDefault().postSticky(msg);
@@ -278,12 +281,12 @@
    }
    private void checkPermissions() {
        if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)
        if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION)
                != PackageManager.PERMISSION_GRANTED) {//未开启定位权限
            //开启定位权限,200是标识码
            ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, 200);
            ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_COARSE_LOCATION}, 200);
        } else {
            if (!isLocationEnable(this)){
            if (!isLocationEnable(this)) {
                Intent locationIntent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
                this.startActivityForResult(locationIntent, 2);
            }