| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package com.google.android.test.activity; |
| 18 |
|
| 19 |
import android.app.Service; |
| 20 |
import android.content.Intent; |
| 21 |
import android.os.Binder; |
| 22 |
import android.os.IBinder; |
| 23 |
import android.util.Log; |
| 24 |
|
| 25 |
public class IsolatedService extends Service { |
| 26 |
Binder mBinder = new Binder(); |
| 27 |
|
| 28 |
@Override |
| 29 |
public void onCreate() { |
| 30 |
super.onCreate(); |
| 31 |
Log.i("IsolatedService", "Service created in pid " + android.os.Process.myPid()); |
| 32 |
} |
| 33 |
|
| 34 |
@Override |
| 35 |
public IBinder onBind(Intent intent) { |
| 36 |
return mBinder; |
| 37 |
} |
| 38 |
|
| 39 |
@Override |
| 40 |
public void onDestroy() { |
| 41 |
super.onDestroy(); |
| 42 |
Log.i("IsolatedService", "Service destroyed in pid " + android.os.Process.myPid()); |
| 43 |
} |
| 44 |
} |