• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Facing problem using Intents..

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..?
 
Sounds like the data is corrupt (from setData), try different ways of setting it and different files.

As miXer said, posting the exception would help us identify the problem.
 
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.
 
Back
Top Bottom