需要一个定时器,两秒发一个数据,用timer,还是用线程,还是别的呢,就是能保证在屏保后他能继续工作
解决方案 »
- eclipse开发android无法调试
- (求助!) Android Socket发送数据延时!
- 问个略微小白的问题:字体画刷怎么设置啊,就是设置字体的填充色。。。。。
- android 看api 里面的button
- 错误:Found both android-support-v4 and android-support-v13 in the dependency list.
- 如果将一个数据数据通过ContentProvider给其他分享?
- layout、layout-land不同布局时如何设置监听
- 请教安卓APP开发的问题
- 为什么捕获不到系统的log,而adb可以
- 大家帮看看,这样的功能用下面哪种方法实现比较合理?
- 用什么软件编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里做你想做的事吧