需要一个定时器,两秒发一个数据,用timer,还是用线程,还是别的呢,就是能保证在屏保后他能继续工作
解决方案 »
- 在/system/app下面的apk
- AndAR android中的ARToolKit 用过的进
- 怎样实现 当启动主线程以后 在主线程里面有一个判断,如果判断成功的话就让其自动开启令一个主线程,同时当前主线程还在运行,用户依然可以对当前线程操作
- android中的contentproider用法
- 求助:为甚么run confirguations只有4.0.3版本
- 关于播放器的问题
- android 连连看 怎么来设置关卡难度
- 怎么转调到其他模块的activity
- [求助]真机Android Socket异常,无法接收返回数据
- android上有没有好的图片压缩算法或工具包?
- 用什么软件编android软件啊?推荐几本书看看呗。
- android UI问题
Intent intent = new Intent(Main.this, MyBroadCastReceiver.class);
intent.setAction("repeating");
PendingIntent Sender = PendingIntent.getBroadcast(Main.this, 0, intent, 0); AlarmManager Alarm =(AlarmManager)getSystemService(ALARM_SERVICE);
Alarm .setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP,SystemClock.elapsedRealtime(), 2*1000,Sender);
在MyBroadCastReceiver里做你想做的事吧