Something like this should work:
Intent intent = new Intent(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file),"application/vnd.android.package-archive");
startActivity(intent);
-- Kostya
11.02.2011 0:11, dashman пишет:
ok - i see what marcin was suggesting.
i download the .apk to the sd card.
now - what intent do i start to install the .apk file.
On Feb 10, 12:36 pm, Mark Murphy<[email protected]> wrote:
On Thu, Feb 10, 2011 at 12:11 PM, dashman<[email protected]> wrote:
i set the mime-type like this
i.setType("application/vnd.android.package-archive");
and the app crashes.
Use setDataAndType(). setType() nulls out your Uri. And, again, this
is only needed if you follow Marcin's recommendation and download the
APK yourself, then use an Intent to kick off installation.
--
Mark Murphy (a Commons
Guy)http://commonsware.com|http://github.com/commonsguyhttp://commonsware.com/blog|http://twitter.com/commonsguy
_The Busy Coder's Guide to Android Development_ Version 3.4 Available!
--
Kostya Vasilyev -- WiFi Manager + pretty widget -- http://kmansoft.wordpress.com
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en