Last active
December 24, 2015 10:39
-
-
Save Androguide/6786224 to your computer and use it in GitHub Desktop.
Snippet to programmatically install an APK on the user's device.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String file = "path/to/the/file.apk"; | |
Intent intent = new Intent( Intent.ACTION_VIEW ); | |
intent.setDataAndType( Uri.fromFile(file), "application/vnd.android.package-archive" ); | |
intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK ); | |
getContext().startActivity(intent); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment