hi guys, i have created a simple file manager, i have this little problem,
when i access a text file, it cannot view the file, but shows a blank one.
here is the code
and i want it also to have a support with pdf and apk. what will i do? please help, thanks
*sorry for the bad english
when i access a text file, it cannot view the file, but shows a blank one.
here is the code
B4X:
Sub ListView1_ItemClick (Position As Int, Value As Object)
Try
If imageview1.Visible = True Then
imageview1.Visible= False
Else
Dim sampler As String
sampler = Value
If File.IsDirectory(directory,Value) = True Then
directory = directory & "/" & Value
populate
Else
If sampler.SubString (sampler.Length - 4) = ".jpg" OR sampler.SubString(sampler.Length - 4) = ".png" OR sampler.SubString(sampler.Length - 4) = ".gif" OR sampler.SubString(sampler.Length - 4) = ".bmp" Then
imageview1.Visible = True
imageview1.Bitmap = LoadBitmap(directory&"/", Value)
Else If sampler.SubString(sampler.Length - 4) = ".mp3" OR sampler.SubString(sampler.Length - 4) = ".wav" OR sampler.SubString(sampler.Length - 4) = ".ogg" Then
StartActivity(pi.PlayAudio(directory & "/",Value))
Else If sampler.SubString(sampler.Length - 4) = ".mp4" OR sampler.SubString(sampler.Length - 4) = ".3gp" Then
StartActivity(pi.PlayVideo(directory & "/", Value))
Else If sampler.SubString(sampler.Length - 4) = ".txt" Then
Dim intent1 As Intent
intent1.Initialize(intent1.ACTION_VIEW,"com.thesis.android.november/" & directory &"/"& Value)
intent1.SetComponent("android/com.android.internal.app.ResolverActivity")
intent1.SetType("text/plain")
StartActivity(intent1)
End If
End If
End If
Catch LastException As Exception
Msgbox(LastException,"OOPS!!")
End Try
End Sub
and i want it also to have a support with pdf and apk. what will i do? please help, thanks
*sorry for the bad english