2012年10月31日
摘要: Service的启动有两种方式:context.startService() 和 context.bindService()。startService();调用者和服务之间没有联系,即使调用者退出了,服务仍然进行启动一个Service的过程如下:context.startService() ->onCreate()- >onStart()->Service running其中onCreate()可以进行一些服务的初始化工作,onStart()则启动服务。停止一个Service的过程如下:context.stopService() | ->onDestroy() -> 阅读全文
posted @ 2012-10-31 18:32 游鱼 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 1.测试类继承AndroidTestCase2.在文件Manifest.xml中加 <uses-library android:name="android.test.runner"/> 这个节点与activity同级, <instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="com.zjr.android.test" android:label="test" > 阅读全文
posted @ 2012-10-31 18:12 游鱼 阅读(213) 评论(0) 推荐(0) 编辑