Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/entity-framework/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 8.0上的Google Play OBB downloader库崩溃_Android_Google Play_Android 8.0 Oreo_Background Service - Fatal编程技术网

Android 8.0上的Google Play OBB downloader库崩溃

Android 8.0上的Google Play OBB downloader库崩溃,android,google-play,android-8.0-oreo,background-service,Android,Google Play,Android 8.0 Oreo,Background Service,OBB下载程序库似乎使用Context.startService(…)在后台下载OBB,但在Android 8.0上,如果应用程序本身在后台,这会导致崩溃。 此库注册广播接收器: mConnReceiver = new InnerBroadcastReceiver(this); IntentFilter intentFilter = new IntentFilter( ConnectivityManager.CONNECTIVITY_ACTION); intentFilter.a

OBB下载程序库似乎使用Context.startService(…)在后台下载OBB,但在Android 8.0上,如果应用程序本身在后台,这会导致崩溃。 此库注册广播接收器:

mConnReceiver = new InnerBroadcastReceiver(this);
IntentFilter intentFilter = new IntentFilter(
        ConnectivityManager.CONNECTIVITY_ACTION);
intentFilter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);
registerReceiver(mConnReceiver, intentFilter);
接收器istelf:

private class InnerBroadcastReceiver extends BroadcastReceiver {
    final Service mService;

    InnerBroadcastReceiver(Service service) {
        mService = service;
    }

    @Override
    public void onReceive(Context context, Intent intent) {
        pollNetworkState();
        if (mStateChanged
                && !isServiceRunning()) {
            Log.d(Constants.TAG, "InnerBroadcastReceiver Called");
            Intent fileIntent = new Intent(context, mService.getClass());
            fileIntent.putExtra(EXTRA_PENDING_INTENT, mPendingIntent);
            // send a new intent to the service
            context.startService(fileIntent);
        }
    }
};
崩溃堆栈stace:

那么,避免此类碰撞的首选方法是什么?或者这种用户体验在Android 8.0+中是正常的