在一项服务中,我准备了一些数据,然后将这些数据储存在一个静态成员变量中,通过广播将一个没有数据的意向发送到主要的UI活动,以使活动知道数据已经编制完毕并随时可以访问。
但既然我每秒需要做10次, 即通过广播发送一个脉冲(完全没有数据)有点过火,
是否有更好的办法做到这一点?
在一项服务中,我准备了一些数据,然后将这些数据储存在一个静态成员变量中,通过广播将一个没有数据的意向发送到主要的UI活动,以使活动知道数据已经编制完毕并随时可以访问。
但既然我每秒需要做10次, 即通过广播发送一个脉冲(完全没有数据)有点过火,
是否有更好的办法做到这一点?
您应该< a href=> http:// developmenter.android.com/guide/potics/fundamentals/services.html#CreateBoundServicice' rel=“nofollow'> 将您的 service
/code> 添加到您的 Message
和 和
handler
设施将您的数据发送到周围。 从您所说的话看, 简单的回调可能适合您的需要。
I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...
I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...
I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...
I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...
To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?
When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...
I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...
I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...