String android.webkit.WebView.getUrl()

운영자 | 기사입력 2013/02/10 [15:10]
안드로이드 >
필자의 다른기사 보기 인쇄하기 메일로 보내기 글자 크게 글자 작게
String android.webkit.WebView.getUrl()
 
운영자   기사입력  2013/02/10 [15:10]
String android.webkit.WebView.getUrl()
현제 url  web_view
self.title = [webPage stringByEvaluatingJavaScriptFromString:@"document.title"]

@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // Adds Progrss bar Support
        this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
        setContentView(R.layout.webview );

        // Makes Progress bar Visible
        getWindow().setFeatureInt( Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON); 

        mWebView = (WebView) findViewById( R.id.webview ); //This is the id you gave 
        //to the WebView in the main.xml
        mWebView.getSettings().setJavaScriptEnabled(true);   
        mWebView.getSettings().setSupportZoom(true);       //Zoom Control on web (You don't need this 
        //if ROM supports Multi-Touch      
        mWebView.getSettings().setBuiltInZoomControls(true); //Enable Multitouch if supported by ROM

        // Load URL
        Bundle b = getIntent().getExtras();
        String url = b.getString("url");
        Log.d(TAG, "url " + url);
        mWebView.loadUrl(url);


        // Sets the Chrome Client, and defines the onProgressChanged
        // This makes the Progress bar be updated.
        mWebView.setWebChromeClient(new WebChromeClient() {
            public void onProgressChanged(WebView view, int progress){
                //Make the bar disappear after URL is loaded, and changes string to Loading...
                myActivity.setTitle("Loading...");
                myActivity.setProgress(progress * 100); //Make the bar disappear after URL is loaded

                // Return the app name after finish loading
                if(progress == 100)
                    myActivity.setTitle(R.string.app_name);
            }
        });

        mWebView.setWebViewClient(new WebViewClient(){

            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                view.loadUrl(url);
                return true;
                // return super.shouldOverrideUrlLoading(view, url);
            }

            @Override
            public void onLoadResource(WebView view, String url) {
                // TODO Auto-generated method stub
                super.onLoadResource(view, url);
            }

            @Override
            public void onPageFinished(WebView view, String url) {
                super.onPageFinished(view, url);
                ImageView logoImageView = (ImageView)findViewById(R.id.logoimage);
                logoImageView.setVisibility(View.GONE);
                Log.d(TAG, "view.getTitle() " + view.getTitle());
                myActivity.setTitle(view.getTitle());
            }

        });

    }
트위터 트위터 페이스북 페이스북 카카오톡 카카오톡
기사입력: 2013/02/10 [15:10]  최종편집: ⓒ iwav
 
 
안드로이드 많이 본 기사