布局文件中,有webview 和 翻页,如下     
 <WebView
        android:id="@+id/flwebview1"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_x="0.1dip"
        android:layout_y="0.1dip" 
        android:layout_weight="1.0" />
 <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="40dip">
   <TextView  
    android:id="@+id/fltextView1"
    android:layout_width="80dip" 
    android:layout_height="40dip" 
    android:text="上一页"
    /> 
   <TextView  
    android:id="@+id/fltextView1"
    android:layout_width="80dip" 
    android:layout_height="40dip" 
    android:text="下一页"
    /> 

</LinearLayout>其中 webview 对应的url为 loadUrl(wv, "http://nc.8ff.cn/forum.php?mod=forumdisplay&fid=251&page=2");
url中page是控制页码的 现问:如何利用布局文件中的 上一页 下一页 来对webview中的内容翻页,thanks

解决方案 »

  1.   

    String url;
    webview.loadUrl(url);
    textview.setonclicklistener();
    设置textview点击事件
    里面
    url="XXX";
    webview.loadUrl(url);不就可以了吗
      

  2.   

    控制页码就
    int a=2;
    url="http://nc.8ff.cn/forum.php?mod=forumdisplay&fid=251&page="+atextview.setonclicklistener();
    设置textview点击事件
    里面
    a++。a--随便你、
    url="XXX"+a;
    webview.loadUrl(url);不就可以了吗
      

  3.   

    如果要节省流量,对于已经看到的Page建议使用
    WebView的方法:通过判断canGoBack() and canGoForward()做goBack() and goForward()
      

  4.   

    这种方法应该没什么问题吧,我以前做j2ee的分页就是用的这种方法
      

  5.   

         //上一页
         ptextView1 = (TextView)findViewById(R.id.pTextView1);
         ptextView1.setOnClickListener(new OnClickListener(){
         public void onClick(View v)
         {   
          Toast.makeText(pageAct.this, "上一页", Toast.LENGTH_SHORT).show();
          page--;
             init();
             if(page<=1)
             {
              page=1;
             }
             loadUrl(wv, "http://nc.8ff.cn/forum.php?mod=forumdisplay&fid=251&page="+page);
         } 
         });
    可以了。
    多谢大家