Apps Facing problem using Intents..

Nilesh Tupe

Lurker
Jan 20, 2011
4
0
5
I am working on file manager application.
I want to launch particular application when user clicks on particular file from the list..
I tried it using Intents

i.setAction(Intent.ACTION_VIEW);
i.setData(Uri.fromFile(f));
i.setType("image/jpg");
startActivity(i);

I tried this program but it is giving some problems.
After clicking on a file it is showing list of possible applications than can handle this file like for image it is showing gallery,astro image viewer etc

but after selecting gallery it is giving exception for gallery application and not handling the file.


what additional things need to be done..?
 
It is giving exceptions which are not thrown from my application but by android application i.e gallery how to handel them?
 
All kinds of exceptions should be visible in logcat. Start logcat from cmd/terminal when the exception is thrown and look for the last exception thrown.