0
点赞
收藏
分享

微信扫一扫

隐示意图启动service的优势

yundejia 2022-05-26 阅读 150

既然显示意图能够简单明了的启动service,为何还要用较为复杂的隐示意图,显然隐示意图有着显示意图没有的功能。—在启动不同包下的service只能用隐示意图,在相同的包下都可以启动。
显示意图

  intent=new Intent(this,MyService.class);
startService(intent);

隐式启动





final Intent serviceIntent=new Intent();
serviceIntent.setAction("com.android.service");


举报

相关推荐

0 条评论