You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
private final BroadcastReceiver mReceiver = new BroadcastReceiver() { @OverRide
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
if (action.equals(BluetoothAdapter.ACTION_STATE_CHANGED)) {
final int state = intent.getIntExtra(BluetoothAdapter.EXTRA_STATE, BluetoothAdapter.ERROR);
// Intent intent1 = new Intent(Chat.this, Select.class);
switch (state) {
case BluetoothAdapter.STATE_OFF:
if(registered) {
unregisterReceiver(mReceiver);
registered=false;
}
@OverRide
public void onConnect(BluetoothDevice device) {
Display("Connected to "+device.getName()+" - "+device.getAddress());
this.runOnUiThread(new Runnable() {
@OverRide
public void run() {
private final BroadcastReceiver mReceiver = new BroadcastReceiver() {
@OverRide
public void onReceive(Context context, Intent intent) {
final String action = intent.getAction();
// startActivity(intent1);
// finish();
break;
case BluetoothAdapter.STATE_TURNING_OFF:
if(registered) {
unregisterReceiver(mReceiver);
registered=false;
}
// startActivity(intent1);
finish();
break;
}
}
}
};
@OverRide
public void onBackPressed() {
I have to close the socket because next time i open it, it fails to connect Says Try again in 3 seconds
Need Help
The text was updated successfully, but these errors were encountered: