简体   繁体   中英

Automatically start a home replacement App after downloading

I have a custom home replacement App, that will not be published on the market. I've implemented an autoupdate functionality to be able to update the customer's app. My question is, is it possible to make the App start defaultly after an update? Now if the user makes an update, the new version is downloaded and installed (replaces the old one), but meanwhile android starts it's default home application (probably, because my is yet not accessible) and the user has to click the home button and choose my application. Is there maybe some directive, or configuration? Thank you. Btw. I install the update with following intent:

Uri packageURI = Uri.parse("package:pl.mymeal.orders");
Intent intent = new Intent(Intent.ACTION_VIEW, packageURI);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + ApkName)), "application/vnd.android.package-archive");
startActivity(intent); 

The short answer is no. Think about the security implications.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM