On Sat, Oct 13, 2012 at 2:16 PM, Pascal Ehlert <dad...@googlemail.com> wrote:
> I am working on a non-market application that is used within our company.
> It has an updater that downloads apks from a web server and is supposed to
> install them.
>
> When I use the following code (tested on Android 4.0) to open the apk, I am
> presented with a selection of applications that can handle the specific
> content type ("application/vnd.android.package-archive"), among them being
> Dropbox and others:
>
> Intent intent = new Intent();
> intent.setDataAndType(Uri.fromFile(new File(path)),
> "application/vnd.android.package-archive");
> startActivity(intent);

I am surprised that Intent works at all, since you have no action. Use
ACTION_INSTALL_PACKAGE on API Level 14+ and ACTION_VIEW on API Level
13 and down.

As a side benefit, I suspect that this will clear up your chooser problem.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 4.2 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to