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

Mike1970

Well-Known Member
Licensed User
Longtime 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

Expert
Licensed User
Longtime 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
 
Upvote 0

Mike1970

Well-Known Member
Licensed User
Longtime 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.
 
Upvote 0

Mike1970

Well-Known Member
Licensed User
Longtime 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
 
Upvote 0
Top