Add handling of tasks being removed.

Change-Id: I6141f17310e61dc6b86052ca81a17a51cc6a2193
This commit is contained in:
Dianne Hackborn
2011-04-12 18:18:24 -07:00
parent 773c80fdb1
commit a8693d8b03
2 changed files with 7 additions and 2 deletions

View File

@@ -530,7 +530,7 @@
<!-- Service Samples -->
<service android:name=".app.LocalService" />
<service android:name=".app.LocalService" android:stopWithTask="true" />
<activity android:name=".app.LocalServiceActivities$Controller"
android:label="@string/activity_local_service_controller"

View File

@@ -135,8 +135,13 @@ public class RemoteService extends Service {
};
// END_INCLUDE(exposing_a_service)
private static final int REPORT_MSG = 1;
@Override
public void onTaskRemoved(Intent rootIntent) {
Toast.makeText(this, "Task removed: " + rootIntent, Toast.LENGTH_LONG).show();
}
private static final int REPORT_MSG = 1;
/**
* Our Handler used to execute operations on the main thread. This is used
* to schedule increments of our value.