Hi Jim, its me Jorge from Grupo Reforma, this is my implementation using SharedPreferences..
static final String PREFS_Zoom = "PREFS_Zoom";
private String zoomlevel;
private int Default_zoomlevel=100;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mWebView = (WebView) findViewById(R.id.webview);
GetZoom();
mWebView.setInitialScale(Default_zoomlevel);
FrameLayout mContentView = (FrameLayout) getWindow().getDecorView().findViewById(android.R.id.content);
View zoom = mWebView.getZoomControls();
mContentView.addView(zoom, ZOOM_PARAMS);
zoom.setVisibility(View.VISIBLE);
WebSettings webSettings = mWebView.getSettings();
webSettings.setSavePassword(false);
webSettings.setSaveFormData(false);
webSettings.setJavaScriptEnabled(true);
webSettings.setSupportZoom(true);
mWebView.loadUrl("http://www.elnorte.com");
}
private void GetZoom(){
try{
SharedPreferences settings = getSharedPreferences(PREFS_Zoom,0);
zoomlevel = settings.getString("zoom_level","");
if (zoomlevel.length() >0)
Default_zoomlevel = Integer.parseInt(zoomlevel);
else
Default_zoomlevel =100;
}catch(Exception ex){
Log.e("******ZOOM ! ", "Exception GetZoom() ::"+ex.getMessage());
}
}
private void SaveZoom(){
try{
SharedPreferences settings = getSharedPreferences(PREFS_Zoom,0);
SharedPreferences.Editor editor = settings.edit();
Default_zoomlevel = (int) (mWebView.getScale() *100);
editor.putString("zoom_level",""+ Default_zoomlevel);
editor.commit();
}catch(Exception ex){
Log.e("******ZOOM ! ", "Exception SaveZoom() ::"+ex.getMessage());
}
}
public void finish() {
SaveZoom();
super.finish();
}
I hope this help