Running activity from remote service

ⅰ亾dé卋堺 提交于 2019-12-01 18:46:34
    1

    You are attempting to open an Activity that has an intent-filter with an action of "com.pushservice.PushActivity". You do not have an Activity that has an intent-filter with an action of "com.pushservice.PushActivity".

    The best answer is to not display an activity from a service, since users will be very irritated with you if you interrupt them when they are using the device.

    • Yes, but my attention with this activity, is not to up any gui which will interrupt the user,but just to do something else in the background but just to work in the background (have no screen that will show up).. how do i have to adjust my manifest in order to run it? – Moshik Apr 29 '10 at 14:08
    • You cannot have an activity "just to do something else in the background but just to work in the background (have no screen that will show up)". That is what services are for. – CommonsWare Apr 29 '10 at 14:49
    • Okie, so ill put it else where, how will you call from a remote service, to another remote service to do another job.. i want to have a modular system, that each remote service will be responsible on some part of the system. – Moshik Apr 29 '10 at 17:59
    • and yes, i am quite sure ive seen an app which operates without gui, it wont work as service in the background, but you can make it to create some operations(and then being closed) without taking the user's focus - have you ever seen something like that? – Moshik Apr 29 '10 at 18:02
    • You absolutely DO NOT WANT TO CREATE LOTS OF REMOTE SERVICES. Each remote service takes up a process, consuming lots of extra RAM, on a device that does not have much RAM to begin with. Your design needs to recognize the limitations of the architecture you are building for. – CommonsWare Apr 29 '10 at 18:49
    2

    You shouldn't call start activity from your service. From Android developers best practice:

    Instead of spawning Activity UIs directly from the background, you should instead use the NotificationManager to set Notifications. These will appear in the status bar, and the user can then click on them at his leisure, to see what your application has to show him.

      Your Answer

      By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

      Not the answer you're looking for? Browse other questions tagged or ask your own question.

      标签
      易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
      该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!