Erel, you're absolutely correct regarding the Gmail app. I cannot open the attachment directly from email, but if I save it and then open it with a file browser - it launches my app with a decent startingintent.
For anyone that finds it useful, these are the four ways I use to get Android to recognise that a file with a ".babc" extension can be launched via my app - either by mimetype association, or simply by the filename extension...
Code:
'*******************************************************
'*** FILTER INTENTS BASED ON HTTP REQUESTS
'*******************************************************
'Handle intent from http request simply based on file extension
AddActivityText(Main,
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:host="*" />
<data android:pathPattern=".*\\.babc" />
<data android:mimeType="*/*" />
</intent-filter>)
'Handle intent from http reqeust based on mimetype
AddActivityText(Main,
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:host="*" />
<data android:pathPattern=".*\\.*" />
<data android:mimeType="application/myappmimetype" />
</intent-filter>)
'*****************************************************
'*** FILTER INTENTS BASED ON CLICKING A BROWSED FILE
'*****************************************************
'Handle intent from a file click simply based on file extension
AddActivityText(Main,
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" />
<data android:host="*" />
<data android:pathPattern=".*\\.babc" />
<data android:mimeType="*/*" />
</intent-filter>
)
'Handle intent from a file click based on mimetype
AddActivityText(Main,
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="file" />
<data android:host="*" />
<data android:pathPattern=".*\\.*" />
<data android:mimeType="application/myappmimetype" />
</intent-filter>)