MOVERIO Pro Developer's Guide (Rev.1.4)
195
■Intent receiver example
class MyReceiver extends BroadcastReceiver {
public MyReceiver() {
super();
}
@Override
public void onReceive(Context context, Intent intent) {
if (intent.getAction().equals(AGPSControl.AGPS_CONF_ERROR)) {
Toast.makeText(getApplicationContext(), "AGPS_CONF_ERROR",
Toast.LENGTH_LONG).show();
Log.d(TAG, "Intent Received | AGPS Conf Error");
}
if (intent.getAction().equals(AGPSControl.AGPS_DOWNLOAD_COMPLETED)) {
Toast.makeText(getApplicationContext(), "AGPS_DOWNLOAD_COMPLETED",
Toast.LENGTH_LONG).show();
Log.d(TAG, "Intent Received | AGPS Download Completed");
}
~~~~~(Omit other intent)~~~~~
}
}
11.7.2.2.
Re-setting of receiver due to application situation transition
Cancel intent receiver when application situation transit like becoming background.
■Receiver cancellation example
@Override
protected void onPause() {
super.onPause();
getApplicationContext().unregisterReceiver(receiver);
}
When returning to application again, re-register the intent receiver.
■Re-register example
@Override
protected void onResume() {
super.onResume();
getApplicationContext().registerReceiver(receiver, filter);
}
Summary of Contents for Moverio Pro BT-2000
Page 7: ...MOVERIO Pro Developer s Guide Rev 1 4 1 1 Introduction ...
Page 12: ...MOVERIO Pro Developer s Guide Rev 1 4 6 2 Developing Apps ...
Page 30: ...MOVERIO Pro Developer s Guide Rev 1 4 24 3 Display control ...
Page 39: ...MOVERIO Pro Developer s Guide Rev 1 4 33 4 UI control ...
Page 47: ...MOVERIO Pro Developer s Guide Rev 1 4 41 5 Voice commands ...
Page 70: ...MOVERIO Pro Developer s Guide Rev 1 4 64 6 Camera control ...
Page 119: ...MOVERIO Pro Developer s Guide Rev 1 4 113 7 Sensor control ...
Page 127: ...MOVERIO Pro Developer s Guide Rev 1 4 121 8 Bluetooth BLE ...
Page 184: ...MOVERIO Pro Developer s Guide Rev 1 4 178 9 Power control ...
Page 187: ...MOVERIO Pro Developer s Guide Rev 1 4 181 10 Self diagnostic function ...
Page 191: ...MOVERIO Pro Developer s Guide Rev 1 4 185 11 GPS Assist ...
Page 202: ...MOVERIO Pro Developer s Guide Rev 1 4 196 Memo ...