How to update WebView when using loadDataWithBaseURL?

I am using loadDataWithBaseURL () to display content in a WebView. I need to update my WebView when clicking the next button, please help me with 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>Here I am</BODY></HTML>", "text/html", Encoding.UTF_8.toString(),""); } }); } } 
+4
source share

All Articles