Service Intent must be explicit: Intent

后端 未结 5 796
你的背包
你的背包 2020-12-01 00:27

I have an app some time now in which I call a service through a broadcast receiver (MyStartupIntentReceiver). The code in the broadcast receiver in order to call the service

5条回答
  •  星月不相逢
    2020-12-01 01:03

    any intent you make to a service, activity etc. in your app should always follow this format

    Intent serviceIntent = new Intent(context,MyService.class);
    context.startService(serviceIntent);
    

    or

    Intent bi = new Intent("com.android.vending.billing.InAppBillingService.BIND");
    bi.setPackage("com.android.vending");
    

    implicit intents (what you have in your code currently) are considered a security risk

提交回复
热议问题