Android Studio报错:Service Intent must be explicit
今天碰到一个报错:Service Intent must be explicit
解决办法这里比较全:
https://stackoverflow.com/questions/27842430/service-intent-must-be-explicit-intent
我采用了其中比较省事的办法,
Intent accessIntent = new Intent(MainActivity.this, KeyAccessibilityService.class);
accessIntent.setAction(Settings.ACTION_ACCESSIBILITY_SETTINGS);
accessIntent.setAction("com.android.vending");
其中关键的就是这一句:accessIntent.setAction("com.android.vending");