开发者

How to refresh WebView when we are using loadDataWithBaseURL?

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(),"");
          }
      });
    }
 }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜