Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9194297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:22:42+00:00 2026-06-17T21:22:42+00:00

Alright, so I have an app that has a custom folder: I want to

  • 0

Alright, so I have an app that has a custom folder:

I want to open the following types:

protected String[] acceptableTypes = {"jpg", "gif", "png", "bmp", "pdf", "txt"};

I can open the images or at least the jgps for sure with the following code whenever I click on the file:

MediaScannerConnection.scanFile(((Activity) getContext()), new String[] { filePath }, null, 
                new MediaScannerConnection.OnScanCompletedListener() { 
            @Override public void onScanCompleted(String path, Uri uri) { 
                Intent intent = new Intent(Intent.ACTION_VIEW); 
                intent.setDataAndType(uri, "image/*"); 
                ((Activity) getContext()).startActivityForResult(intent, ConferenceActivity.ACTIVITY_SELECT_IMAGE); 
            } 
        });

Now how can I filter this so that I can open the correct file type with the correct program?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T21:22:44+00:00Added an answer on June 17, 2026 at 9:22 pm

    Read http://developer.android.com/guide/components/intents-filters.html for an intro on how to do this. Search from “image/” on that page.

    You need to declare the file types in your application’s manifest file. Be sure and declare them using a mimeType like “image/*” or “image/png” so that you can open the files from other applications like gmail.

    In your activity you would add something like this:

    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <data android:mimeType="image/*" />
    </intent-filter>
    

    The other catch is that you also have to handle both “file” schemes and “content” schemes. To see what I mean open a file from Gmail in Jellybean and you will see that the URI you are provided is a content type instead of the typical file type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright heres the deal. I have a sports app that i want to update
Alright, here we go. I have a cocos2d app, and there are targets that
Alright so I have an app that I would like to have utilize other
Alright, so I'm at wits' end. I have an app that utilizes pushing and
Alright so I have a task, that I have to let the client try
Alright. My app has a text field and next to it are two buttons
I have a resources web app, which only has static content, such as images,
Alright, so here's the dealio: I'm working on a Ruby app that'll take data
Hey, alright so I have a .plist that looks like; <plist version=1.0> <dict> <key>Item
Alright, so I'm building a web app that provides music information (i.e. info on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.