package com.example.viewpager01;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebSettings.ZoomDensity;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.TextView;
 
public class BrowserFragment extends Fragment 
{
 
    WebView browser; 
    String url;
    TextView msg;
     
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) 
    {
 
        View view=inflater.inflate(R.layout.fragment, container, false);
   
        browser=(WebView)view.findViewById(R.id.my_browser);
        browser.setWebViewClient(new WebViewClient());
        
        
      
        msg = (TextView) findViewById(R.id.textView1);
        
        msg.setText("3456");
        
        browser.getSettings().setBuiltInZoomControls(true);
        browser.getSettings().setUseWideViewPort(true);
        browser.getSettings().setLoadWithOverviewMode(true);
        browser.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
        //browser.setInitialScale(0);
        browser.getSettings().setDefaultZoom(ZoomDensity.FAR);
        
        browser.loadUrl(url); 
        
        // Just load whatever URL this fragment is
        // created with.
        return view;
    }
  
    private TextView findViewById(int textview1) {
		// TODO Auto-generated method stub
		return null;
	}

	// This is the method the pager adapter will use
    // to create a new fragment
    public static Fragment newInstance(String url)
	{
	        BrowserFragment f=new BrowserFragment();
	        f.url=url;
	        return f;
    }
  
}