Open file from network drive

Stulish

Active Member
Licensed User
Longtime User
Hi all,

i have been playing with the SMB lib and trying to make a basic explorer program (i have attached a zip).

the file now seems to work really well and displays the correct icon depending on file type along with the name of the file also showing file size and date last modified.

The network path is displayed at the top of the screen and to go back use the back button on the phone/tablet.

I have now tried to get the app to open when a file is clicked the code snipped to open the file is below (inside the files_TtemClick subroutine):

B4X:
   Dim i As Intent 
      i.Initialize(i.ACTION_VIEW,Value)
      i.SetType(fileInf.GetFileType(Value))   
      StartActivity(i)

i get the following error:


the log can be seen below:



There is also an error when i change orientation or exit the app and then go back in, it says label or listview not initialized, but it always works on the first use. I have tried initializing the views but strange behavior happens depending on where i initialize.

Any advice would be appreciated.
 

Attachments

  • screen_shot.png
    94.6 KB · Views: 537
  • network_explorer.zip
    59.6 KB · Views: 482
Last edited:

alienhunter

Active Member
Licensed User
Longtime User
nice work

thanks for sharing this code, it is working very well .
Linux and windows

I got one question how do i add a file extension so it will be not "Unknown" anymore ?

example : *.nc

it is slipping thru this : " If fType<>"Unknown" Then "

thanks
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…