Install another built-in apk from one built-in apk
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 );
}
}