1

コンテンツをロードする場合とロードしない場合があるため、webview に問題があります。
2.2 と 2.3.3 の Android バージョンでは問題がなく、4.0.4 の Android バージョンでのみ問題がないことに気付きました。

私のコードは次のとおりです。

public class MywebviewActivity extends Activity {

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    this.getWindow().requestFeature(Window.FEATURE_PROGRESS);
    setContentView(R.layout.mywebview);
    final Activity MywebviewActivity = this;        
      // Makes Progress bar Visible
      getWindow().setFeatureInt(Window.FEATURE_PROGRESS, Window.PROGRESS_VISIBILITY_ON);
      android.webkit.WebView wv = 
      (android.webkit.WebView)this.findViewById(R.id.myWebView); 
      wv.setWebChromeClient(new WebChromeClient() {     
      public void onProgressChanged(WebView view, int progress)   
      {
       //Make the bar disappear after URL is loaded, and changes string to Loading...
          MywebviewActivity.setTitle("Loading...");
          MywebviewActivity.setProgress(progress * 100); //Make the bar disappear after URL is loaded

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

      wv.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
      wv.getSettings().setJavaScriptEnabled(true);
      wv.setHorizontalScrollBarEnabled(false);
      wv.loadUrl("http://mypagename.com/android/server/app/ver10/page1.html");

    }

public void onBackPressed() {
    android.os.Process.killProcess(android.os.Process.myPid());
    return;
}
4

1 に答える 1

1

ハードウェア アクセラレーションは、GPU を使用してビューのキャンバスで実行されるすべての描画操作を実行します。アプリケーションがハードウェア アクセラレーションされているかどうかを確認します。

View.isHardwareAccelerated()

View がハードウェア アクセラレーション ウィンドウに接続されている場合は true を返します。false を返す場合は、追加します

android:hardwareAccelerated ="true"

のために<activity

マニフェスト ファイルの要素。

于 2012-09-22T07:56:37.390 に答える