03-10-2011 11:56 PM
Hello,
I have an AlertDialog pop-up with some regular text, part of which is a link to a website. I therefore added the text with HTML using messageHtml as such:
alertDialog.messageHtml = "<p> Some Text "<br /> <a href=\"www.website.com\"> www.website.com </a> </p>";
However, when I run this in the simulator (newest version - 0.9.3), the website does not appear as a hyperlink, and you cannot click it.
Am I doing this correctly? The reason I ask is because I heard that an App has gotten rejected due to a website not being written as a hyperlink. Perhaps it does not appear as a hyperlink in the simulator, but it will on the actual device?
Any help would be appreciated!
Thank you!
03-11-2011 08:09 AM
Not all HTML is supported in the dialog class package. You will need to verify that the hyperlink tag (A) is supported. Also, try adding a target for the HREF ("_blank") to see if that would do it.
03-11-2011 11:07 AM
Adding a "_blank" target for the href did not work unfortunately. I have been unable to find specific documentation regarding supported HTML for the alertdialog class package, but it seems that it is not supported...
03-11-2011 11:14 AM
It "may" in the next release because there were no obvious enhancements to the Dialog package at the same time we received a browser with the OS. My guess is that it was not a requirement to support that tag in HTML. You can add a button to the dialog to browse to some site using navigateToURL.
03-11-2011 11:25 AM
Thank you for your response again.
Basically there is an "info" button in my app that pops up an alertDialog box. There I list some contact information, such as e-mail addreses. I just want to make sure that BB would not reject the app simply because those are not hyperlinks. I also have a "rules" button that pops up an alertDialog with the rules of the game, and then I provide the website on the bottom to cite where the rules came from. As far as I'm concerned, it does not matter to me if the site is a hyperlink. However, I feel as if BB may reject it simply because of that. Can you give me any suggestions on that? Or perhaps another way to present the "rules" and "info" to the user instead of alertDialog boxes?
Thank you!
03-11-2011 11:29 AM
Problem with a hyperlink, you are then requiring the person to be connected to the internet to view these items. You could have a button that does a navigateToURL to a local "rules.html" file that was installed with your app.
03-11-2011 02:13 PM
Thank you, this is what I am trying to do now.
However, for the life of me, I cannot get the navigateToURL() to work with a local file. I feel as if I have exhausted all the possible syntax, but it just will not load the local file. I can get it to work no problem with a http site however.
Any help would be great! Thank you again!
03-11-2011 02:29 PM
There are some threads on this. It was something like:
file://path/rules.html
I cant recall if it was just file:// or file:///
03-11-2011 02:32 PM
03-11-2011 02:40 PM
@jtegen It was file://