Running activity from remote service

后端 未结 2 986
悲哀的现实
悲哀的现实 2021-01-19 13:04

iam trying to run an activity from diffrent package from my remote service: this is how i implement the service.java

  public class CurrencyService extends S         


        
2条回答
  •  天涯浪人
    2021-01-19 13:19

    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.

提交回复
热议问题