Code example for WebView: Displaying web pages

Methods: scrollTo, startAnimation, x 1

0
            @Override 
            public void onClick(View v) {
                wv.loadUrl("javascript:Reader2.show_next_item();");
                wv.loadUrl("javascript:Reader2.is_next_item();");
                wv.loadUrl("javascript:Reader2.is_prev_item();");
                if (nextPost.isEnabled())
                    fadeInWebView(); 
            } 
        }); 
 
        prevPost = (ImageButton) v.findViewById(R.id.up);
        prevPost.setOnClickListener(new OnClickListener() {
 
            @Override 
            public void onClick(View v) {
                wv.loadUrl("javascript:Reader2.show_prev_item();");
                wv.loadUrl("javascript:Reader2.is_next_item();");
                wv.loadUrl("javascript:Reader2.is_prev_item();");
                fadeInWebView(); 
            } 
        }); 
 
        return v;
    } 
 
    private void fadeInWebView() { 
        AlphaAnimation fadeInAnimation = new AlphaAnimation(0.0f, 1.0f);
        fadeInAnimation.setDuration(800);
        wv.scrollTo(0, 0);
        wv.startAnimation(fadeInAnimation);
    } 
 
    public void onAttach(Activity activity) {
        super.onAttach(activity);
        try { 
            // check that the containing activity implements our callback 
            loadExternalURLListener = (LoadExternalURLListener) activity;
        } catch (ClassCastException e) {