Italian [RISOLTO] Visualizzare file testo

Discussion in 'Italian Forum' started by MAX_SV, Feb 4, 2015.

  1. MAX_SV

    MAX_SV Active Member Licensed 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
     
  2. MAX_SV

    MAX_SV Active Member Licensed User

    ho provato con :
    Code:
    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 :-(
     
  3. maxware

    maxware Well-Known Member Licensed User

    Ciao MAx
    prova senza la barra
    i.Initialize(i.ACTION_VIEW, "file:" & File.DirRootExternal & "/dati.csv")
     
  4. MAX_SV

    MAX_SV Active Member Licensed User

    niente da fare non funge .... :-(

    log:
    Code:
    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)
     
  5. maxware

    maxware Well-Known Member Licensed User

    prova ad aggiungere il settype
    es.
    I.SetType("application/msexcel")
     
    MAX_SV likes this.
  6. MAX_SV

    MAX_SV Active Member Licensed User

    ok perfetto è possibile aprirlo con un visualizzatore file testo "normale"?
    sei sempre un grande
     
  7. maxware

    maxware Well-Known Member Licensed User

    ottimo
    se non ricordo male se metti
    I.SetType("*/*")
    ti chiede con cosa vuoi aprirlo 8 ma potrei sbagliarmi )
     
  8. MAX_SV

    MAX_SV Active Member Licensed User

    ricordi in modo perfetto funziona alla grande
    segno il thread come risolto :)
     
  9. maxware

    maxware Well-Known Member Licensed User

    Okkkkkkkkkk ottimo
     
  10. MAX_SV

    MAX_SV Active Member Licensed User

    Per completezza in questo post vengono elencati i vari parametri I.SetType
     
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