开发者

How to keep a thread listening while the activity is not in the focus?

I have a client program, inside that I have thread... myClient { myListener_In_a_THREAD( relevant function... ); }

this_function_is_called_in_the_thread(...code that can listen to incoming text, and display);

Now...what I want is,

  1. I am playing angry bird...
  2. But, the program myClient should be able to listen to the incoming 开发者_高级运维text...
  3. If any text comes... it should be able to bring the interface forward! (or provide an option at least)

To achieve that, what should I do? If you know, please explain and if you know, please give code example!

Thanks


This is usually done using Service and NotificationManager classes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜