Android 4.4.Installation of APK startActivityForResult calls onActivityResult directly

where the request code > 0, standard mode, 7.0 (real machine), 8.0 (virtual machine) can.

private void installApp() {
        Intent intent = new Intent(Intent.ACTION_VIEW);
        File file = new File(appTask.path);
        textAppProgressStatus.setText("");
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
            Uri contentUri = FileProvider.getUriForFile(this, BuildConfig.APPLICATION_ID + ".fileProvider", file);
            intent.setDataAndType(contentUri, "application/vnd.android.package-archive");
        } else {
            // FIXME: 2018/8/2 Android 4.4 API 19 startActivityForResult  onActivityResult
            intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        }
        Log.d(TAG, "installApp: ");
        startActivityForResult(intent, REQUEST_CODE_INSTALL);
}

change intent.setFlags (Intent.FLAG_ACTIVITY_NEW_TASK);
to intent.setFlags (0); to

reference: https://stackoverflow.com/que.

QAQ is posted by myself again

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e46ba8-436b5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e46ba8-436b5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?