Epson Moverio Pro BT-2000 Developer's Manual page 201

Hide thumbs Also See for Moverio Pro BT-2000:
Table of Contents

Advertisement

■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);
}
MOVERIO Pro Developer's Guide (Rev.1.4)
195

Advertisement

Table of Contents
loading

This manual is also suitable for:

Moverio pro bt-2200

Table of Contents