Downloading attachment from g/email in Android
GMail doesn't let you click URL's with unknown schemes, so you can use the schema that beginning with "http://".
To define in manifest do something like this:
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="http" android:host="com.yourdomain.yourapp"/>
</intent-filter>
Reading gmail attachment in my app
The answer appears to be that the activity was set to be 'single instance' for various reasons. This means that whilst it is brought to the foreground again, it comes back with the intent it was originally started with, not the one created by gmail.
Removing the 'single instance' attribute allowed the correct intent to be used.
Android: File Extension Intent Filter does not work properly with GMail/Downloads app
I got it working by putting content into its own intent-filter group along with a file data scheme, both having a mime-type of application/octet-stream.
<intent-filter android:priority="999" >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.OPENABLE" />
<data
android:scheme="http"
android:host="*"
android:pathPattern=".*\\.sbu" />
<data
android:scheme="https"
android:host="*"
android:pathPattern=".*\\.sbu" />
<data
android:scheme="ftp"
android:host="*"
android:pathPattern=".*\\.sbu" />
<data
android:scheme="ftps"
android:host="*"
android:pathPattern=".*\\.sbu" />
<data
android:scheme="file"
android:host="*"
android:pathPattern=".*\\.sbu" />
</intent-filter>
<intent-filter android:priority="999" >
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.OPENABLE" />
<data
android:scheme="file"
android:mimeType="application/octet-stream"
android:pathPattern=".*\\.sbu" />
<data
android:scheme="content"
android:mimeType="application/octet-stream"
android:pathPattern=".*\\.sbu" />
</intent-filter>
Related Topics
Why Does Calling Getwidth() on a View in Onresume() Return 0
Get Font Scaling Factor to Calculate the Fontsize
Automatic Versioning of Android Build Using Git Describe with Gradle
Android Webview Cannot Render Youtube Video Embedded via Iframe
Eclipse Hangs at The Android Sdk Content Loader
Fragmentpageradapter Getitem Is Not Called
Tracking Progress of Multipart File Upload Using Okhttp
How to Change The Navigationview's Item Text Size
Ionic2 Background Image Is Resized When Keyboard Is Open
How to Apply Custom CSS to Android Webview When Url Is from Internet Server
How to Get Rid of Incremental Annotation Processing Requested Warning
How to Perform Minification and Obfuscation with the Jack Compiler
Shared Preferences Reset Data When App Is Force Closed or Device Is Restarted
Android Different Edittext Backgrounds for Different States Using Shapes, Selector or List