It started working when i used startActivity(uiIntent); instead of
startService(uiIntent);

On Jan 26, 4:37 pm, Titus <[email protected]> wrote:
> Hello All,
> I have been trying to install an apk from the code but i haven't been
> successful. could some one who has done ti tell me where is the
> issue?
>
> I was using the below snippet
>
>                 Uri packageUri = Uri.fromFile(new 
> File("data/data/MyService.apk"));
>                 Log.e(TAG,"Path->"+packageUri.getEncodedPath());
>                 Intent uiIntent = new Intent(this, MyService.class);
>                 uiIntent.setAction(android.content.Intent.ACTION_VIEW);
>                 uiIntent.setData(packageUri);
>                 uiIntent.setType("application/vnd.android.package-archive");
>                 startService(uiIntent);
>
> I get the below error
>  Unable to start service Intent { act=android.intent.action.VIEW
> typ=application/vnd.android.package-archive cmp=com.android.myactivity/
> com.android.myservice.MYService }: not found
>
> PS: I get the encoded path right, I am able to open the file and get
> the size of the file too

-- 
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

Reply via email to