Added cancel buttons to permissions dialogs. Fixed crash from issue #45
This commit is contained in:
@@ -240,8 +240,12 @@ public class LogManager {
|
||||
+ DatabaseUtils.sqlEscapeString(sdData.toJSON(true)) + ","
|
||||
+ 0
|
||||
+ ")";
|
||||
mOsdDb.execSQL(SQLStr);
|
||||
Log.v(TAG, "data written to database");
|
||||
if (mOsdDb != null) {
|
||||
mOsdDb.execSQL(SQLStr);
|
||||
Log.v(TAG, "writeDatapointToLocalDb(): data written to database");
|
||||
} else {
|
||||
Log.e(TAG,"writeDatapointToLocalDb(): mOsdDb is null");
|
||||
}
|
||||
|
||||
} catch (SQLException e) {
|
||||
Log.e(TAG, "writeToLocalDb(): Error Writing Data: " + e.toString());
|
||||
|
||||
@@ -646,6 +646,11 @@ public class StartupActivity extends AppCompatActivity {
|
||||
SMS_PERMISSIONS_1,
|
||||
45);
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancelBtnTxt), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
}).create().show();
|
||||
}
|
||||
}
|
||||
@@ -666,12 +671,18 @@ public class StartupActivity extends AppCompatActivity {
|
||||
.setPositiveButton(getString(R.string.okBtnTxt), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
Log.i(TAG,"requestLocationPermissions1(): Launching ActivityCompat.requestPermissions()");
|
||||
Log.i(TAG, "requestLocationPermissions1(): Launching ActivityCompat.requestPermissions()");
|
||||
ActivityCompat.requestPermissions(StartupActivity.this,
|
||||
LOCATION_PERMISSIONS_1,
|
||||
43);
|
||||
}
|
||||
}).create().show();
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancelBtnTxt), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
})
|
||||
.create().show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -696,6 +707,11 @@ public class StartupActivity extends AppCompatActivity {
|
||||
LOCATION_PERMISSIONS_2,
|
||||
44);
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancelBtnTxt), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
}).create().show();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user