Android Question Very strange Error while using PhoneIntents.OpenBrowser(...) (drawer)

Mike1970

Well-Known Member
Licensed User
Hi everyone,
i've a CustomListView in a [b4x]Drawer, with some items. Each item has a Value, this value is a custom type called "ComunicationData" that contains several strings, like cd.Link
When i click on the clv item, the sub "ItemClick" is fired and is this one:

Cattura.PNG


As you can see the code in the Sub is pretty simple, but it crashes.
In the right side you can see that in cd.Link there is the string!, but on StartActivity(pi.OpenBrowser(cd.link)) it crashes.
The full error is:
(Exception) java.lang.Exception: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat= [URL]http://www.google.it/[/URL] flg=0x20000 }

If I replace cd.Link with http://www.google.it/ it works properly 😅

Thanks in advance
 
Last edited:

Mahares

Well Known Member
Licensed User
If I replace cd.Link with http://www.google.it it works properly
Check the spelling of your variable . In the error message you have a slash at the end of string, but in your post text you write is without a slash.. If this does no solve it, please show your values that are stored in the custom type cd.
Also, please put your code and error message as text not images
 

Mike1970

Well-Known Member
Licensed User
Check the spelling of your variable . In the error message you have a slash at the end of string, but in your post text you write is without a slash.. If this does no solve it, please show your values that are stored in the custom type cd.
Also, please put your code and error message as text not images
the value stored in cd.Link is visible in the logs, first line in black, it is the result of the “Log” in the “ItemClick” sub

however I tried also without the /, no difference.
and it shouldn’t make any difference.
 

Mike1970

Well-Known Member
Licensed User
@Mahares
I solved the mistery.

In the long SQL query i used to store the records containing the links, i wrote like so:
[...]' r.GetString("Link")', [...]

i put by error a space between the r.GetString and the first apex!

so there was a space behind the link, i noticed it because i tried to put a .Trim and it started working.. so i understood.

thanks for your help
 
Top