Hi All,

First post! Yay.

I don't really understand the concepts behind Intent/Context/Actions
etc, so to learn something I thought I would follow the tutorials over
@ AndDev.org to create a basic File Browser application. The code was
written for the previous SDK so I had to modify it a little to get it
to work and for the most part it does. The part I am having issues
with is getting the browser to start activities when you click on a
specific file (e.g. Open PhotoPicker when you click on a png image
etc.)

Inside my onClickedItem I have the following:

            // Check to see if it is a file
            // .......
            // If it is a file doe the following
            try {
                Intent myIntent = new
Intent(android.content.Intent.ACTION_VIEW,
 
Uri.parse("file://" + aFile.getAbsolutePath().toString());
                startActivity(myIntent)
            } catch (Exception e) {
                e.printStackTrace();
            }

When I run this I get an ActivityNotFoundException

Is this how to correctly use Intents to open files? Perhaps I should
be checking the file's MIME type and trying to find the relevant
application that way. How would one achieve this?

Thanks for any help you can give me on this. I look forward to being
able to contribute back to the community in any way I can :-)

Regards,
David
I <3 android!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to