Android Question Manifest's intent-filter for MimeType "text/*"

Discussion in 'Android Questions' started by peacemaker, Feb 5, 2019.

  1. peacemaker

    peacemaker Well-Known Member Licensed User

    HI, All

    I'd like to receive by the app files of some kinds:
    Code:
    AddActivityText(Main,
    <
    intent-filter>
       <action android:name=
    "android.intent.action.SEND" />
       <category android:name=
    "android.intent.category.DEFAULT" />
       <data android:mimeType=
    "image/*" />
       <data android:mimeType=
    "text/*" />
       <data android:mimeType=
    "application/pdf" />
       <data android:mimeType=
    "application/msword" />
       <data android:mimeType=
    "application/vnd.openxmlformats-officedocument.wordprocessingml.document" />
       <data android:mimeType=
    "application/vnd.ms-excel" />
       <data android:mimeType=
    "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
    </
    intent-filter>)
    PDF, MS Office, images are almost OK (some *.doc? and *.xls? not always can be opened by MS Office, but always opened by other viewers\printers).

    But no .txt files are filtered (to be captured). What's wrong ?
     
  2. DonManfred

    DonManfred Expert Licensed User

    have you tried
    text/plain
     
  3. peacemaker

    peacemaker Well-Known Member Licensed User

    Sure, first of all. No my app in the list, but all messengers, file explorers... are in the filter list.
     
  4. DonManfred

    DonManfred Expert Licensed User

    try "text/rtf"
     
  5. peacemaker

    peacemaker Well-Known Member Licensed User

    No help. And "text/*" covers it as "plain".
    Should... :(
     
  6. peacemaker

    peacemaker Well-Known Member Licensed User

    Maybe it's only on my Samsung A7 (Android 8) such trouble ?

    Extra filter like this does not help also:
    Code:
    AddActivityText(Main,
    <
    intent-filter>
        <action android:name=
    "android.intent.action.SEND" />
        <category android:name=
    "android.intent.category.DEFAULT" />
        <category android:name=
    "android.intent.category.BROWSABLE" />
        <data android:pathPattern=
    ".*\\.txt" />
       <data android:mimeType=
    "text/plain" />
    </
    intent-filter>)
    I unpacked Viber APK, it has such filter:
    Code:
    <intent-filter>
                    <action android:name=
    "android.intent.action.SEND"/>
                    <category android:name=
    "android.intent.category.DEFAULT"/>
                    <data android:mimeType=
    "image/*"/>
                    <data android:mimeType=
    "video/*"/>
                    <data android:mimeType=
    "text/plain"/>
                    <data android:mimeType=
    "text/*"/>
                    <data android:mimeType=
    "*/*"/>
                </
    intent-filter>
    But i do not need all files "*/*". And if i set such mime types - "No app installed for opening" a .txt file i try.

    Attached the test project to check - start and try to share a .txt file from any app to this test app.
     

    Attached Files:

  7. peacemaker

    peacemaker Well-Known Member Licensed User

    I have found suddently that .txt files i choose to be shared has MIME type as "application/txt" !
    Intent filter how is OK, but...
    Code:
    AddActivityText(Main,
    <
    intent-filter>
       <action android:name=
    "android.intent.action.SEND" />
       <category android:name=
    "android.intent.category.DEFAULT" />
       <data android:mimeType=
    "image/*" />
       <data android:mimeType=
    "application/txt" />
       <data android:mimeType=
    "application/pdf" />
       <data android:mimeType=
    "application/msword" />
       <data android:mimeType=
    "application/vnd.openxmlformats-officedocument.wordprocessingml.document" />
       <data android:mimeType=
    "application/vnd.ms-excel" />
       <data android:mimeType=
    "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
    </
    intent-filter>)
    ... but there are no one app working with such MIME-type, so ACTION_VIEW is impossible.
    Replacing "application/txt" to "text/plain" partially helps, but not fully...
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice