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

  • Home
  • SEARCH
  • 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 7588927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:03:05+00:00 2026-05-30T20:03:05+00:00

I have seen numerous answers on here about creating an intent filter for a

  • 0

I have seen numerous answers on here about creating an intent filter for a custom file extension, but none of them seem to be answering my question:

I have an intent filter that works right now… when I browse for my file or when I open it from an email attachment, my app will appear in the list. The file itself has a custom extension of “tgtp”, but it is basically just an xml file.

The problem I am having is that although this intent filter works, it also appears to add my app to every chooser for every type of file on my phone. An example would be if I clear my contacts app defaults and click on one of my contacts, it says my app can open it.

I’ve tried dozens of different combinations of intent filters with different schemes, mime types, etc… and some still let me open the file if i browse with a file browser, but I specifically need to be able to open email attachments and open as file browser. I am yet to find an intent filter(s) that allow me to do that without making my app available for every other intent chooser.

Here is my current intent-filter that uses my app to open everything:

<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="*/*" />
<data android:pathPattern=".*\\.tgtp" />   
</intent-filter>

Thank you in advance

  • 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-05-30T20:03:06+00:00Added an answer on May 30, 2026 at 8:03 pm

    The only way to solve this problem is add scheme and host attributes to your intent filter:

    <intent-filter>
      <action android:name="android.intent.action.VIEW" />
      <category android:name="android.intent.category.DEFAULT" />
      <data android:scheme="file" />
      <data android:mimeType="*/*" />
      <data android:pathPattern=".*\\.tgtp" />   
      <data android:host="*" />
    </intent-filter>
    

    That is because in documentation says that android:pathPattern only works if has an scheme and host defined.
    http://developer.android.com/guide/topics/manifest/data-element.html

    Hope it helps.

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

Sidebar

Related Questions

I have seen numerous posts about the IE Webpage has expired error message, but
Ok, I've seen numerous variations on this question, but none exactly answer what I'm
I have reviewed numerous reports of this error but the solutions I have seen
I've seen numerous posts about Dates and comparing, but I'm looking for something in
I have seen numerous examples of the Command pattern But they all tend to
I have seen examples of printing from a windows application but I have not
I have seen lots of questions recently about WPF... What is it? What does
I have seen the official demos on lwjgl.org but I would like to see
I have seen a lot of discussions going on and people asking about DataGrid
I've seen numerous posts in random places about how to set up a WYSIWYG

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.