Android Service 笔记
2010-08-22 04:47:00 来源:WEB开发网< Button android:id="@+id/btnStartService" android:text="StartService"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
< Button android:id="@+id/btnStopService" android:text="StopService"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
< /TableRow>
< TableRow android:layout_width="fill_parent" android:gravity="center"
android:layout_height="wrap_content" android:paddingTop="24px">
< Button android:id="@+id/btnBindService" android:text="BindService"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
< Button android:id="@+id/btnUbindService" android:text="UbindService"
android:layout_width="wrap_content" android:layout_height="wrap_content" />
< /TableRow>
< /TableLayout>
< ?xml version="1.0" encoding="utf-8"?>
< manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.service" android:versionCode="1" android:versionName="1.0">
< application android:icon="@drawable/icon" android:label="@string/app_name">
< activity android:name=".ServiceDemo" android:label="@string/app_name">
< intent-filter>
< action android:name="android.intent.action.MAIN" />
< category android:name="android.intent.category.LAUNCHER" />
< /intent-filter>
< /activity>
< service android:name=".MyTestService" android:enabled="true"
android:process=":local" >
< /service>
< /application>
< uses-sdk android:minSdkVersion="4" />
< /manifest>
更多精彩
赞助商链接