1. Are you ready for the Galaxy S20? Here is everything we know so far!

Facing problem using Intents..

Discussion in 'Android Development' started by Nilesh Tupe, Feb 8, 2011.

  1. Nilesh Tupe

    Nilesh Tupe Lurker
    Thread Starter

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



    1. Download the Forums for Android™ app!


      Download

       
  2. miXer

    miXer Android Enthusiast

    Can you post the exception thrown in logcat?
     
  3. Tapirboy

    Tapirboy Newbie

    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.
     
  4. Nilesh Tupe

    Nilesh Tupe Lurker
    Thread Starter

    It is giving exceptions which are not thrown from my application but by android application i.e gallery how to handel them?
     
  5. miXer

    miXer Android Enthusiast

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

Share This Page

Loading...