I am using loadDataWithBaseURL() to display the contents on WebView. I need to refresh my WebView on clicking next button, please help me out in this concern.
Here is my sample code
public class screen extends Activity
{
WebView browser;
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.temp);
browser = (WebView)findViewById(R.id.WebView01);
browser.loadDataWithBaseURL("", "<HTML><BODY>Here we are<P>1</P><P>2</P><P>3</P><P>4</P><P>5</P></BODY></HTML>", "text/html", Encoding.UTF_8.toString(),"");
next.setOnClickListener(new View.OnClickListener()
{
public void onClick(View view)
{
screen.this.browser.loadDataWithBaseURL("", "<HTML><BODY&g开发者_JAVA技巧t;Here I am</BODY></HTML>", "text/html", Encoding.UTF_8.toString(),"");
}
});
}
}
精彩评论