Android L (API 21) - java.lang.IllegalArgumentException: Service Intent must be explicit

后端 未结 1 1748
鱼传尺愫
鱼传尺愫 2020-11-27 22:50

Android new version - \"Lollipop\" (API 21) brings quite a few changes with it, but it comes with some price if you wish to target your app to that API.

When we star

1条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-27 23:24

    Start the service explicitely

    intent = new Intent(context, Service.class);
    

    OR explicitly provide the package in an implicit intent

    intent = new Intent("com.example.intent.ACTION");
    intent.setPackage("com.example")
    

    0 讨论(0)
提交回复
热议问题