I am showing a Alertbox after clicking a button. The Alert box is customised one. Along with the Alert title it has to show a web address like http://www.google.com. While clicking the web it site has to load in a seperate Activity with the content of the specific address.I am using a webview and the website is loading successfully the problem is, not able to show the web address in alertbox. It will be better if i can show it as a link.
thanks and regards
Parvathi
String text = "<a href=http://www.google.de>Link zum klicken</a>";
builder.setMessage(Html.fromHtml(text));
Related
Currently, I have a WebView which opens my google drive pdf file which is encrypted (it has a password)
My project
it shows a dialog where I need to input a password,
now my problem is;
Is it possible to set a text in the input?
After the WebView retrieve the URL,
is it possible to set a text in the dialog?
thank you.
Hi i have data that contains HTML image tag and some text. To display this content i am using webView by following approach:
String getProductDetailsTechSpec = "<img src="http://myhost.com/myimages/image.jpg"/></br>Here is the content of my article. Yada Yada. Etc. Etc."
getProductDetailsTechSpec.loadDataWithBaseURL("", getTechSpec,
"text/html", "UTF-8", "");
when device is connected to the wi-fi or mobile data, image is displying properly and when user turn off the wi-fi/Mobile data after some time image does not displaying(it works for few mins because webview get cached the image but after some time it doesn't) . But text is still is working. Please give me suggestion hot to get rid of this problem.
Thanks in advance.
The text is working because simply the webview is able to draw the HTML tags that you're writing even if there is no internet connection .. just like if your write that HTML to a text file and run in with the browser in your computer ..
But for the image the webview displays it from a URL which needs connection to display it
if your're looking for a way to cache the image , you might wanna check out that link
I created an application in android to connect to mongodb. the programs main page consists of a loading a webpage via webview in my system, i used apache as application server. in apache, inside www folder all my php and html pages are there , and i am able to load those pages, and from that page i can go to all the pages and back via the application itself, my question is that while i go from one page to another, can a toast messege be shown in the screen?. i mean as a notification can a toast message be displayed when a page link is clicked from the emulator?
my question is that while i go from one page to another, can a toast
message be shown in the screen?. i mean as a notification can a toast
message be displayed when a page link is clicked from the emulator?
=> Yes you can use WebViewClient for your WebView to achieve that. You can write Toast notification code inside shouldOverrideUrlLoading() method.
i mean as a notification can a toast message be displayed when a page
link is clicked from the emulator?
If you want to show a message to User when "URL are going to be loaded" you need to assign WebViewClient to your WebView.
All what you need to do is override for example onPageStarted() method1:
#Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
// show message to Use
Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
}
1Or also you can override shouldOverrideUrlLoading() method.
I can open a url from my app but i want to make that url non editable or to hide the url from the user. So that the user can't edit it(address bar - read only) or if that is not possible then hide the address bar from the user.
I used webview to display the webPage
I implemented the the Android webview encounter some problem
Beginning do a OptionMenu, and he will appear when you press the Menu four locations
I use the mouse click taipei he displayed to Toast
But I would like to implement the functionality Toast message screen webview display the specified web page
I use Intent a = new Intent (Intent.ACTION_VIEW, Uri.parse ();
startActivity (a);
Can successfully display the webpage
But I would like to the webview implement web pages using setContentView ();
Switch to taipei.xml <= webview, when I click on the submit button, it could not display the webpage using webview
Please help me to see where the problems lie, because beginners just learning, I hope to try to attach the code to solve my problem.
Code URL: [I implemented the the Android webview encounter some problem
Beginning do a OptionMenu, and he will appear when you press the Menu four locations
I use the mouse click taipei he displayed to Toast
But I would like to implement the functionality Toast message screen webview display the specified web page
I use Intent a = new Intent (Intent.ACTION_VIEW, Uri.parse ("http://www.taipei-101.com.tw/"));
startActivity (a);
Can successfully display the webpage
But I would like to the webview implement web pages using setContentView ();
Switch to taipei.xml <= webview, when I click on the submit button, it could not display the webpage using webview
Please help me to see where the problems lie, because beginners just learning, I hope to try to attach the code to solve my problem.
Code URL: http://www.javaworld.com.tw/jute/post/view?bid=26&id=312960&sty=1#312960
And attach performed on screen picture
And attach performed on screen picture in the cod URL
Implore help thank you