File extension when open custom file with Xamarin Android -
i'm trying open custom file in xamarin android app when open can't file extension correctly or name of file. tried onedrive , works not google drive or downloads app.
this androidmanifest:
<application android:allowtaskreparenting="true" ...> <activity android:launchmode="singletask" ...> <intent-filter android:autoverify="true"> <action android:name="android.intent.action.view" /> <category android:name="android.intent.category.default" /> <category android:name="android.intent.category.browsable" /> <data android:scheme="content" android:mimetype="application/octet-stream" android:pathpattern=".*\\.pec" /> <data android:scheme="content" android:mimetype="application/*" android:pathpattern=".*\\.pec" /> <data android:scheme="content" android:mimetype="*/*" android:pathpattern=".*\\.pec" /> </intent-filter> ... </activity> </application>
i intent in onnewintent method because i'm using singletask launchmode. code this:
protected override void onnewintent(intent intent) { string action = intent.action; string type = intent.type; an.uri fileuri = intent.data; string filename = fileuri.lastpathsegment; }
and fileuri , filename.
from onedrive: content://com.microsoft.skydrive.content.external/drive/id/1/item/rid/8e63bb6d425f77da%217395/stream/1/property/kn.pec
from google drive: content://com.google.android.apps.docs.storage.legacy/enc%3dlu5kldi4leii_fqer6niunah6hjv_wgjrqzdf64tsrrqnyqi
from downloads: content://com.android.providers.downloads.documents/document/4169
Comments
Post a Comment