Android Question Path/File Info from My Files

Discussion in 'Android Questions' started by xfernal, Jul 27, 2015.

  1. xfernal

    xfernal Member Licensed User

    I have added KML file association to my app in the manifest like:
    AddActivityText(OpenKML,
    <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=".*\\.kml" />
    <data android:mimeType="*/*" />
    </intent-filter>
    )
    AddActivityText(OpenKML,
    <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/vnd.google-earth.kml+xml" />
    </intent-filter>)

    If I use My Files app (Android's built in file explorer) and click on a KML file, this works correctly and opens the OpenKML module within my app. How do I get the path/file that was clicked on so I can use in within OpenKML module?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Check Log(Activity.GetStringIntent.ExtrasToString).
     
    DonManfred likes this.
  3. xfernal

    xfernal Member Licensed User

    Thanks Erel. You had a typo though. It is GetStartingIntent.
    This is what I needed: Activity.GetStartingIntent.GetExtra("key_filename")
     
    Erel and DonManfred like this.
Loading...