I have a TextView that is updated but I cannot see the refresh until i minimize and reopen the application. here is the code that performs that.
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    bleAdapter = ((BluetoothManager) getSystemService(BLUETOOTH_SERVICE)).getAdapter();
    Set<BluetoothDevice> pairedDevices = bleAdapter.getBondedDevices();
    for (BluetoothDevice device : pairedDevices) {
        device.connectGatt(this, true, new BluetoothGattCallback() {
            @Override
            public void onConnectionStateChange(BluetoothGatt gatt, int status, int newState) {
                super.onConnectionStateChange(gatt, status, newState);
                TextView state;
                switch (newState) {
                    case BluetoothProfile.STATE_CONNECTED: 
                        state = (TextView)findViewById(R.id.state);
                        state.setText("Connected = True");
                        state.setTextColor(Color.GREEN);
                        break;
                    case BluetoothProfile.STATE_DISCONNECTED:
                        state = (TextView)findViewById(R.id.state);
                        state.setText("Connected = False");
                        state.setTextColor(Color.RED);
                        break;
                }
            }
        });
    }
}
What I need to refresh that TextView? I'm doing anything else wrong?
 
    