java 소스
package exam.checkcheck;
import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
import android.widget.ProgressBar;
public class checkcheck extends Activity {
private static final String DEFAULT_URL = "http://www.naver.com";
private ProgressBar mPbProgress;
private WebView mWvBrowser;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mPbProgress = (ProgressBar)findViewById(R.id.web_view_example_activity_pb_progress);
mWvBrowser = (WebView)findViewById(R.id.web_view_example_activity_wv_browser);
mWvBrowser.getSettings().setJavaScriptEnabled(true);
mWvBrowser.setWebViewClient(new WebViewClient());
mWvBrowser.loadUrl("DEFAULT_URL);
mWvBrowser.setWebChromeClient(new WebChromeClient()
{
public void onProgressChanged(WebView view, int progress)
{
if (progress<100)
{
mPbProgress.setVisibility(ProgressBar.VISIBLE);
}
else if (progress==100)
{ mPbProgress.setVisibility(ProgressBar.GONE); }
mPbProgress.setProgress(progress);
}
});
}
}
-------------------------------------------------------------------------------------------------------------------------------------------
xml 파일
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:background="#FFFFFF" >
<ProgressBar
android:id="@+id/web_view_example_activity_pb_progress"
android:layout_width="fill_parent"
android:layout_height="5dp"
style="?android:attr/progressBarStyleHorizontal" />
<WebView
android:id="@+id/web_view_example_activity_wv_browser"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
------------------------------------------------------------------------------------------------------
manifest 파일
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="exam.checkcheck"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="9" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".checkcheck"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
왜 안될까요??? ㅠㅠ
그냥 실행도안되고 꺼집니다. ㅠㅠ