2014年4月4日

摘要: 为了方便android系统中不同应用间的通信,android提供了aidl。客户端访某个应用的service时,将IBInder对象的代理传递给ServiceConnection的onServiceConnected方法的第二个参数。一、服务端应用的实现interface ICat{ String getColor(); double getWeight();}/** * */package org.crazyit.service;import java.util.Timer;import java.util.TimerTask;import org.crazyit.service.ICat. 阅读全文
posted @ 2014-04-04 10:30 axiaoquana 阅读(154) 评论(0) 推荐(0)

2014年3月26日

摘要: 在程序中,如果在activity中绑定了服务,而没有在destory中,写unbind,会出现这种异常,Activity com.neusoft.dsn.infoplayer.InfoPlayerActivity has leaked ServiceConnection com.neusoft.dsn.infoplayer.InfoPlayerActivity$2@405189f8 that was originally bound here解决办法,在destory中,加上context.unbindService(u'r ServiceConnection) 阅读全文
posted @ 2014-03-26 16:27 axiaoquana 阅读(232) 评论(0) 推荐(0)

2014年3月25日

摘要: 1、发送广播使用Intent发送广告Intent intent=new Intent();intent.setAction("mybroadcast");sendBroadcast(intent);2.在xml注册广播接收者 2、接收广播public class My extendsBroadcastReceiver{public void onReceive(Context context, Intent intent) { System.out.println("接收");} } 阅读全文
posted @ 2014-03-25 18:23 axiaoquana 阅读(276) 评论(0) 推荐(0)

导航