Italian [RISOLTO] Visualizzare file testo

MAX_SV

Active Member
Licensed User
Longtime User
Come al solito sono a chiedervi aiuto.
Dopo aver scaricato una pagina web e in seguito trasformata in un file csv adesso avrei la necessità di visualizzare il file utilizzando il programma predefinito sul device ?
Grazie
 

MAX_SV

Active Member
Licensed User
Longtime User
ho provato con :
B4X:
Sub apri_csv_click
    Private i As Intent
    Try
    i.Initialize(i.ACTION_VIEW, "file:/" & File.DirRootExternal & "/dati.csv")
        StartActivity(i)
    Catch
        ToastMessageShow("errore", True)         
    End Try

End Sub
i viene popolata con: file://storage/emulated/0/dati.csv
ma non trova il file .... che invece esiste :-(
 

MAX_SV

Active Member
Licensed User
Longtime User
Ciao MAx
prova senza la barra
i.Initialize(i.ACTION_VIEW, "file:" & File.DirRootExternal & "/dati.csv")
niente da fare non funge .... :-(

log:
B4X:
Error occurred on line: 349 (main)
android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=file:/storage/emulated/0/dati.csv flg=0x20000 }
    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1632)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1424)
    at android.app.Activity.startActivityForResult(Activity.java:3424)
    at android.app.Activity.startActivityForResult(Activity.java:3385)
    at android.app.Activity.startActivity(Activity.java:3627)
    at android.app.Activity.startActivity(Activity.java:3595)
    at anywheresoftware.b4a.keywords.Common.StartActivity(Common.java:696)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:680)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:308)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:515)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:159)
    at nuoto.incifre.main$B4AMenuItemsClickListener.onMenuItemClick(main.java:170)
    at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:147)
    at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:874)
    at com.android.internal.view.menu.MenuPopupHelper.onItemClick(MenuPopupHelper.java:177)
    at android.widget.AdapterView.performItemClick(AdapterView.java:299)
    at android.widget.AbsListView.performItemClick(AbsListView.java:1113)
    at android.widget.AbsListView$PerformClick.run(AbsListView.java:2904)
    at android.widget.AbsListView$3.run(AbsListView.java:3638)
    at android.os.Handler.handleCallback(Handler.java:733)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:149)
    at android.app.ActivityThread.main(ActivityThread.java:5061)
    at java.lang.reflect.Method.invokeNative(Native Method)
 

MAX_SV

Active Member
Licensed User
Longtime User
prova ad aggiungere il settype
es.
I.SetType("application/msexcel")
ok perfetto è possibile aprirlo con un visualizzatore file testo "normale"?
sei sempre un grande
 

MAX_SV

Active Member
Licensed User
Longtime User
ricordi in modo perfetto funziona alla grande
segno il thread come risolto :)
 

MAX_SV

Active Member
Licensed User
Longtime User
Per completezza in questo post vengono elencati i vari parametri I.SetType
 
Top