pathPattern to match file extension does not work if a period exists elsewhere in the file name?

Ran into the same problem trying to open a file in a dot folder. I found I could just add multiple “data” elements, depending on how many dots I expected to have in my paths:

<data android:pathPattern=".*\\.mytype"/>
<data android:pathPattern=".*\\..*\\.mytype"/>
<data android:pathPattern=".*\\..*\\..*\\.mytype"/>
<data android:pathPattern=".*\\..*\\..*\\..*\\.mytype"/>

Ugly, though. Anyone know a better way?

Leave a Comment