- Forum posts: 1
Jan 10, 2018, 11:51:21 AM via Website
Jan 10, 2018 11:51:21 AM via Website
Disconnect() and close() are not working in android nougat.so what is the alternative?
this is my code,
@Override
public void onBackPressed()
{
Log.e(TAG,"onBackPressed in connectActivity");
new AlertDialog.Builder(mContext).setMessage("Do you want to exit?")
.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
bleMessagingService.disconnect();
sessionManager.exit();
finish();
// sessionManager.exit();
}
})
.setNegativeButton("CANCEL",new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
}).create().show();
}