Don't set text onunbound gui elements
This commit is contained in:
parent
9e099ec741
commit
97bbc00dcf
1 changed files with 17 additions and 12 deletions
|
@ -153,19 +153,24 @@ public class DanaRFragment extends SubscriberFragment {
|
||||||
activity.runOnUiThread(
|
activity.runOnUiThread(
|
||||||
new Runnable() {
|
new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (c.sStatus == EventPumpStatusChanged.CONNECTING)
|
synchronized(DanaRFragment.this){
|
||||||
btConnectionView.setText("{fa-bluetooth-b spin} " + c.sSecondsElapsed + "s");
|
|
||||||
else if (c.sStatus == EventPumpStatusChanged.CONNECTED)
|
|
||||||
btConnectionView.setText("{fa-bluetooth}");
|
|
||||||
else if (c.sStatus == EventPumpStatusChanged.DISCONNECTED)
|
|
||||||
btConnectionView.setText("{fa-bluetooth-b}");
|
|
||||||
|
|
||||||
if (!status.equals("")) {
|
if(btConnectionView == null || pumpStatusView == null || pumpStatusLayout == null ) return;
|
||||||
pumpStatusView.setText(status);
|
|
||||||
pumpStatusLayout.setVisibility(View.VISIBLE);
|
if (c.sStatus == EventPumpStatusChanged.CONNECTING)
|
||||||
} else {
|
btConnectionView.setText("{fa-bluetooth-b spin} " + c.sSecondsElapsed + "s");
|
||||||
pumpStatusLayout.setVisibility(View.GONE);
|
else if (c.sStatus == EventPumpStatusChanged.CONNECTED)
|
||||||
|
btConnectionView.setText("{fa-bluetooth}");
|
||||||
|
else if (c.sStatus == EventPumpStatusChanged.DISCONNECTED)
|
||||||
|
btConnectionView.setText("{fa-bluetooth-b}");
|
||||||
|
|
||||||
|
if (!status.equals("")) {
|
||||||
|
pumpStatusView.setText(status);
|
||||||
|
pumpStatusLayout.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
pumpStatusLayout.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue