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...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice