码迷,mamicode.com
首页 >  
搜索关键字:serviceconnection    ( 37个结果
从头学Android之Service初步二
在上一篇,我们学习了通过startService来启动Service,由于篇幅过长,所以这一篇是接上一篇的 二、bindService方法启动Service 先看bindSerivce(Intent service,ServiceConnection conn,int flags)函数 参数说明:...
分类:移动开发   时间:2014-11-16 14:48:02    阅读次数:345
百度定位API报错:leaked ServiceConnection com.baidu.location.LocationClient$1@426122f0
使用百度MapApi定位时候,当退出当时使用的activity后,则会报如题的异常,解决办法:1:当退出当前定位的activity时,一定要在onDestroy方法中要mLocClient.stop();2:百度定位对应的service在Manifest中定义如下,切记,一定要加上过滤器:andro...
分类:Windows程序   时间:2014-11-12 01:55:35    阅读次数:230
Android Exception 12(has leaked ServiceConnection)
09-09 15:12:31.154: E/ActivityThread(18855): Activity com..xxx.xx.act.LoadingAct has leaked ServiceConnection com..xxx.xx.act.LoadingAct$2@42086478 th...
分类:移动开发   时间:2014-09-09 17:38:49    阅读次数:266
Develop系列-API Guides-应用组件-Services-Bound Services
Bound Services CS架构,其中C是调用组件,S是Bound Services; C通过bindService来绑定,这个方法立即返回,没有返回值,C需要实现ServiceConnection里面的onServiceConnected和onServiceDisconnected接口。 多...
分类:Windows程序   时间:2014-08-19 23:58:25    阅读次数:639
android service和activity的通讯
我们需要用以下方式来启动service: Intent intent = new Intent(); intent.setClass(MainActivity.this, MyService.class); bindService(intent,conn,BIND_AUTO_CREATE); ServiceConnection conn = new ServiceConn...
分类:移动开发   时间:2014-07-28 00:28:29    阅读次数:214
客户端如何调用IBinder接口对象
代码: public void funclick(View view){ Intent _intent = new Intent(MainActivity.this,MyService.class); bindService(_intent, conn, BIND_AUTO_CREATE); } private ServiceConnection conn = new Serv...
分类:其他好文   时间:2014-07-20 23:11:45    阅读次数:310
Service & Timer & Handler & leaked ServiceConnection
定义一个Service,每隔一秒钟,变量count增加1;在Activity里bindService,然后利用new Timer() 和 Handler,每隔一秒利用IBinder实例mBinder的getNumber()方法读取count的最新值,并显示在TextView.首次运行,报错。Debu...
分类:其他好文   时间:2014-06-28 23:15:44    阅读次数:307
37条   上一页 1 2 3 4
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!