Install another built-in APK from one built-in APK

Source: Internet
Author: User

Click the built-in APK to install the APK that has been built into the system.



Package com. Wind. bbminstaller;



Import java. Io. file;


Import Android. App. activity;
Import Android. content. intent;
Import android.net. Uri;
Import Android. OS. Bundle;


Public class mainactivity extends activity {
Static final int request_install = 1;
@ Override
Protected void oncreate (bundle savedinstancestate ){
Super. oncreate (savedinstancestate );
Setcontentview (R. layout. Main );
Installproductname M ();
}


Private void installproductname M (){
Uri uri = URI. fromfile (new file ("/data/APP/bbm.apk "));
Intent intent2 = new intent (intent. action_install_package );
Intent2.setdata (URI );
Intent2.putextra (intent. extra_not_unknown_source, true );
Intent2.putextra (intent. extra_return_result, true );
Intent2.putextra (intent. extra_allow_replace, true );
Intent2.putextra (intent. extra_installer_package_name, getapplicationinfo (). packagename );
Startactivityforresult (intent2, request_install );
}
}

Install another built-in APK from one built-in APK

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.