Intent.Getextra

mlc

Active Member
Licensed User
Longtime User
I hope you can help me

From the Share menu, of the device, I get in my app this intent: intent.action.send
B4X:
    Dim In As Intent
    In = Activity.GetStartingIntent
   
    Log(In)   
'(Intent) Intent { act=android.intent.action.SEND typ=text/plain flg=0x3800000 cmp=mlc.calendar/.main (has extras) }
    Log(In.ExtrasToString)
'Bundle[{android.intent.extra.STREAM=file:///mnt/sdcard/Sin%20t%C3%ADtulo.txt}]

The actual name of the file is: "Sin título.txt" , when I try to retrieve the file, I get this error :
B4X:
java.io.FileNotFoundException: //mnt/sdcard/Sin%20t%C3%ADtulo.txt (No such file or directory)

If I change the name of the file, to : "Sintitulo.txt" , I can retrieve it without problems.

How I can retrieve the correct file name with spaces and accents?

Thanks
 

mlc

Active Member
Licensed User
Longtime User
Thanks Erel

It works perfectly

B4X:
'f = //mnt/sdcard/Sin%20t%C3%ADtulo.txt
Dim su As StringUtils
            f = su.DecodeUrl(f ,"UTF8")

I get

f = //mnt/sdcard/Sin título.txt


As always 5 stars for you
 
Upvote 0
Top