How to disconnect a ble device manually

  • Replies:3
  • OpenNot stickiedUnanswered
  • Forum posts: 2

Jan 11, 2018, 1:27:59 PM via Website

I am trying to disconnect ble device onbackpress but it does not work public void onBackPressed() {
//super.onBackPressed();
AlertDialog.Builder adb = new AlertDialog.Builder(this);
adb.setTitle("DISCONNECT");
adb.setMessage("Do you want to disconnect");
adb.setPositiveButton("OK", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {

            bleMessagingService.disconnect();

            Intent intentSplash = new Intent(getApplication().getApplicationContext(), ConnectActivity.class);           
            startActivity(intentSplash);                
            dialog.dismiss();
         }
    });
    adb.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
        @Override
        public void onClick(DialogInterface dialog, int which) {
            dialog.dismiss();
        }
    });
    AlertDialog alertDialog = adb.create();
    alertDialog.show();
}

Reply
  • Forum posts: 36

Jan 12, 2018, 2:06:46 PM via Website

What device are you using? You could root device and remove ble app and drivers then restart device then reinstall ble app and drivers

Reply

Recommended articles