android - how to open a local file in android -


i trying open local kml file in sdcard getting error.in stackoverflow have seen questions related not answered , not related this.

android - how open kml file in android

android - how open google maps intent , kml?

my code

public void openkmlfile(view v)      final intent myintent = new intent(android.content.intent.action_view,              uri.parse("geo:0,0?q=file://" + environment.getexternalstoragedirectory() + "/test.kml"));     startactivity(myintent); } 

android manifest file have given permission

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"     package="com.example.demo"     android:versioncode="1"     android:versionname="1.0" >      <uses-sdk         android:minsdkversion="8"         android:targetsdkversion="16" />     <uses-permission android:name="android.permission.internet"/>     <uses-permission android:name="android.permission.write_external_storage"/>      <application         android:allowbackup="true"         android:icon="@drawable/ic_launcher"         android:label="@string/app_name"         android:theme="@style/apptheme" >          <activity             android:name="com.example.demo.mainactivity"             android:label="@string/app_name" >             <intent-filter>                 <action android:name="android.intent.action.main" />                  <category android:name="android.intent.category.launcher" />             </intent-filter>         </activity>     </application>  </manifest> 

logcat error :

04-05 11:42:01.806: e/androidruntime(833): fatal exception: main 04-05 11:42:01.806: e/androidruntime(833): java.lang.runtimeexception: unable start activity componentinfo{com.example.demo/com.example.demo.mainactivity}: android.content.activitynotfoundexception: no activity found handle intent { act=android.intent.action.view dat=geo:0,0?q=file:///mnt/sdcard/10.kml } 04-05 11:42:01.806: e/androidruntime(833): caused by: android.content.activitynotfoundexception: no activity found handle intent { act=android.intent.action.view dat=geo:0,0?q=file:///mnt/sdcard/10.kml } 

your appreciated.thank you


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -