zoomIn/Out finctions didnt work for me in WebView/WebViewClient

2 views
Skip to first unread message

DineshG

unread,
May 7, 2009, 11:49:18 AM5/7/09
to Auto-android

Also the pageDown and pageUp functions are not taking affest on the
screen.
I suspect I need to just refresh the screen somehow to let them take
affect . Is that so ?

Is there anything special needs to be done for letting these functions
take affect on the screen, and can I call them in a loop ?

This is what I am trying :

package com.android.mybrowser;

import android.app.Activity;
import android.os.Bundle;
import android.webkit.*;


public class MyBrowser extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
super.onCreate(savedInstanceState);

WebView wView = (WebView)findViewById(R.id.wv1);

WebSettings wSet = wView.getSettings();
wSet.setJavaScriptEnabled(true);
wView.setWebViewClient(new myClient()) ;
wView.loadUrl("file:///android_asset/myWebPage.htm");
l
}


private class myClient extends WebViewClient {

public void onPageStarted(WebView view, String url,
android.graphics.Bitmap favicon) {
}

public void onPageFinished(WebView view, String url) {

view.zoomOut();
view.zoomIn();
view.pageDown(true);
view.pageUp(true);

finish();

}
}

}
Reply all
Reply to author
Forward
0 new messages