スポンサーリンク
カテゴリー
タグ
ActionBar adb admob alarmmanager background fetch BOOT_COMPLETED BroadcastReceiver canvas DATE_CHANGED dp dpi EditText get launchMode ListView menu Notification NSURLSession PACKAGE_REPLACED paint PhoneStateListener post px READ_EXTERNAL_STORAGE SQLite storyboard surfaceview tableview TelephonyManager TimeZone TIMEZONE_CHANGED TIME_SET UIActivityIndicatorView UILabel WebView アイコン クリップボード ソフトウェアキーボード パーミッション ヘアライン ライフサイクル 回転 変換 正規表現 解像度リンク
「WebView」タグアーカイブ
WebViewでGET/POSTの結果を表示する
GETの場合
1 |
webview.loadUrl("http://example.com/?param1=value1¶m2=value2"); |
POSTの場合
1 2 |
String postData = "param1=value1¶m2=value2"; webview.postUrl("http://example.com/", postData.getBytes()); |
ただし、サーバ側でPOST元の制限をされてい … 続きを読む
WebViewが落ちる
WebViewでしばらくブラウジングしていると、動作が極端に重くなり最期は強制終了する。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
09-03 09:31:53.947: D/audio_hw_primary(181): select_devices: out_snd_device(2: speaker) in_snd_device(0: ) 09-03 09:31:53.947: D/ACDB-LOADER(181): ACDB -> send_afe_cal 09-03 09:31:54.457: I/Ads(20296): Scheduling ad refresh 60000 milliseconds from now. 09-03 09:31:55.959: I/ActivityManager(586): START u0 {cmp=com.skelabo.xxxx/.MyBrowser (has extras)} from pid 20296 09-03 09:31:56.029: W/AwContents(20296): nativeOnDraw failed; clearing to background color. 09-03 09:31:56.049: I/ActivityManager(586): Displayed com.skelabo.xxxx/.MyBrowser: +81ms 09-03 09:31:56.059: W/AwContents(20296): nativeOnDraw failed; clearing to background color. 09-03 09:31:56.409: I/chromium(20296): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported 09-03 09:31:57.700: W/Adreno-EGLSUB(20296): <DequeueBuffer:606>: dequeue native buffer fail: Unknown error 2147483646, buffer=0x0, handle=0x0 09-03 09:31:57.700: W/Adreno-EGLSUB(20296): <SwapBuffers:1382>: Invalid native buffer. Failed to queueBuffer 09-03 09:31:57.700: W/Adreno-EGLSUB(20296): <updater_thread:456>: native buffer is NULL 09-03 09:31:57.710: E/BufferQueue(178): [com.skelabo.xxxx/com.skelabo.xxxx.MyBrowser] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count 09-03 09:31:57.710: W/Adreno-EGLSUB(20296): <DequeueBuffer:606>: dequeue native buffer fail: Invalid argument, buffer=0x0, handle=0x0 09-03 09:31:57.710: W/Adreno-ES20(20296): <gl2_surface_swap:43>: GL_OUT_OF_MEMORY 09-03 09:31:57.710: W/Adreno-EGL(20296): <qeglDrvAPI_eglSwapBuffers:3597>: EGL_BAD_SURFACE 09-03 09:31:57.710: W/HardwareRenderer(20296): EGL error: EGL_BAD_SURFACE 09-03 09:31:57.730: W/HardwareRenderer(20296): Mountain View, we've had a problem here. Switching back to software rendering. 09-03 09:31:58.711: E/Surface(20296): dequeueBuffer failed (Unknown error 2147483646) 09-03 09:31:58.711: E/ViewRootImpl(20296): Could not lock surface 09-03 09:31:58.711: E/ViewRootImpl(20296): java.lang.IllegalArgumentException 09-03 09:31:58.711: E/ViewRootImpl(20296): at android.view.Surface.nativeLockCanvas(Native Method) 09-03 09:31:58.711: E/ViewRootImpl(20296): at android.view.Surface.lockCanvas(Surface.java:243) 09-03 09:31:58.711: E/ViewRootImpl(20296): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2435) 09-03 09:31:58.711: E/ViewRootImpl(20296): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2409) 09-03 09:31:58.711: E/ViewRootImpl(20296): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2253) 09-03 09:31:58.711: E/ViewRootImpl(20296): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1883) 09-03 09:31:58.711: E/ViewRootImpl(20296): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000) 09-03 09:31:58.711: E/ViewRootImpl(20296): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670) 09-03 09:31:58.711: E/ViewRootImpl(20296): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) 09-03 09:31:58.711: E/ViewRootImpl(20296): at android.view.Choreographer.doCallbacks(Choreographer.java:574) 09-03 09:31:58.711: E/ViewRootImpl(20296): at android.view.Choreographer.doFrame(Choreographer.java:544) 09-03 09:31:58.711: E/ViewRootImpl(20296): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) 09-03 09:31:58.711: E/ViewRootImpl(20296): at android.os.Handler.handleCallback(Handler.java:733) 09-03 09:31:58.711: E/ViewRootImpl(20296): at android.os.Handler.dispatchMessage(Handler.java:95) 09-03 09:31:58.711: E/ViewRootImpl(20296): at android.os.Looper.loop(Looper.java:136) 09-03 09:31:58.711: E/ViewRootImpl(20296): at android.app.ActivityThread.main(ActivityThread.java:5017) 09-03 09:31:58.711: E/ViewRootImpl(20296): at java.lang.reflect.Method.invokeNative(Native Method) 09-03 09:31:58.711: E/ViewRootImpl(20296): at java.lang.reflect.Method.invoke(Method.java:515) 09-03 09:31:58.711: E/ViewRootImpl(20296): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 09-03 09:31:58.711: E/ViewRootImpl(20296): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 09-03 09:31:58.711: E/ViewRootImpl(20296): at dalvik.system.NativeStart.main(Native Method) 09-03 09:32:20.933: D/dalvikvm(649): GC_CONCURRENT freed 1061K, 75% free 12488K/48928K, paused 6ms+5ms, total 69ms 09-03 09:32:27.369: E/BufferQueue(178): [com.skelabo.xxxx/com.skelabo.xxxx.MyBrowser] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count 09-03 09:32:27.379: E/Surface(20296): dequeueBuffer failed (Invalid argument) 09-03 09:32:27.379: E/ViewRootImpl(20296): Could not lock surface 09-03 09:32:27.379: E/ViewRootImpl(20296): java.lang.IllegalArgumentException 09-03 09:32:27.379: E/ViewRootImpl(20296): at android.view.Surface.nativeLockCanvas(Native Method) 09-03 09:32:27.379: E/ViewRootImpl(20296): at android.view.Surface.lockCanvas(Surface.java:243) 09-03 09:32:27.379: E/ViewRootImpl(20296): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2435) 09-03 09:32:27.379: E/ViewRootImpl(20296): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2409) 09-03 09:32:27.379: E/ViewRootImpl(20296): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2253) 09-03 09:32:27.379: E/ViewRootImpl(20296): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1883) 09-03 09:32:27.379: E/ViewRootImpl(20296): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000) 09-03 09:32:27.379: E/ViewRootImpl(20296): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670) 09-03 09:32:27.379: E/ViewRootImpl(20296): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) 09-03 09:32:27.379: E/ViewRootImpl(20296): at android.view.Choreographer.doCallbacks(Choreographer.java:574) 09-03 09:32:27.379: E/ViewRootImpl(20296): at android.view.Choreographer.doFrame(Choreographer.java:544) 09-03 09:32:27.379: E/ViewRootImpl(20296): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) 09-03 09:32:27.379: E/ViewRootImpl(20296): at android.os.Handler.handleCallback(Handler.java:733) 09-03 09:32:27.379: E/ViewRootImpl(20296): at android.os.Handler.dispatchMessage(Handler.java:95) 09-03 09:32:27.379: E/ViewRootImpl(20296): at android.os.Looper.loop(Looper.java:136) 09-03 09:32:27.379: E/ViewRootImpl(20296): at android.app.ActivityThread.main(ActivityThread.java:5017) 09-03 09:32:27.379: E/ViewRootImpl(20296): at java.lang.reflect.Method.invokeNative(Native Method) 09-03 09:32:27.379: E/ViewRootImpl(20296): at java.lang.reflect.Method.invoke(Method.java:515) 09-03 09:32:27.379: E/ViewRootImpl(20296): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 09-03 09:32:27.379: E/ViewRootImpl(20296): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 09-03 09:32:27.379: E/ViewRootImpl(20296): at dalvik.system.NativeStart.main(Native Method) 09-03 09:32:27.439: D/audio_hw_primary(181): select_devices: out_snd_device(2: speaker) in_snd_device(0: ) 09-03 09:32:27.439: D/ACDB-LOADER(181): ACDB -> send_afe_cal 09-03 09:32:27.940: E/BufferQueue(178): [com.skelabo.xxxx/com.skelabo.xxxx.MyBrowser] dequeueBuffer: can't dequeue multiple buffers without setting the buffer count 09-03 09:32:27.940: E/Surface(20296): dequeueBuffer failed (Invalid argument) 09-03 09:32:27.940: E/ViewRootImpl(20296): Could not lock surface 09-03 09:32:27.940: E/ViewRootImpl(20296): java.lang.IllegalArgumentException 09-03 09:32:27.940: E/ViewRootImpl(20296): at android.view.Surface.nativeLockCanvas(Native Method) 09-03 09:32:27.940: E/ViewRootImpl(20296): at android.view.Surface.lockCanvas(Surface.java:243) 09-03 09:32:27.940: E/ViewRootImpl(20296): at android.view.ViewRootImpl.drawSoftware(ViewRootImpl.java:2435) 09-03 09:32:27.940: E/ViewRootImpl(20296): at android.view.ViewRootImpl.draw(ViewRootImpl.java:2409) 09-03 09:32:27.940: E/ViewRootImpl(20296): at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2253) 09-03 09:32:27.940: E/ViewRootImpl(20296): at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1883) 09-03 09:32:27.940: E/ViewRootImpl(20296): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1000) 09-03 09:32:27.940: E/ViewRootImpl(20296): at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5670) 09-03 09:32:27.940: E/ViewRootImpl(20296): at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761) 09-03 09:32:27.940: E/ViewRootImpl(20296): at android.view.Choreographer.doCallbacks(Choreographer.java:574) 09-03 09:32:27.940: E/ViewRootImpl(20296): at android.view.Choreographer.doFrame(Choreographer.java:544) 09-03 09:32:27.940: E/ViewRootImpl(20296): at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747) 09-03 09:32:27.940: E/ViewRootImpl(20296): at android.os.Handler.handleCallback(Handler.java:733) 09-03 09:32:27.940: E/ViewRootImpl(20296): at android.os.Handler.dispatchMessage(Handler.java:95) 09-03 09:32:27.940: E/ViewRootImpl(20296): at android.os.Looper.loop(Looper.java:136) 09-03 09:32:27.940: E/ViewRootImpl(20296): at android.app.ActivityThread.main(ActivityThread.java:5017) 09-03 09:32:27.940: E/ViewRootImpl(20296): at java.lang.reflect.Method.invokeNative(Native Method) 09-03 09:32:27.940: E/ViewRootImpl(20296): at java.lang.reflect.Method.invoke(Method.java:515) 09-03 09:32:27.940: E/ViewRootImpl(20296): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 09-03 09:32:27.940: E/ViewRootImpl(20296): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 09-03 09:32:27.940: E/ViewRootImpl(20296): at dalvik.system.NativeStart.main(Native Method) 09-03 09:32:27.940: I/Ads(20296): Scheduling ad refresh 60000 milliseconds from now. 09-03 09:32:28.050: E/chromium(20296): [ERROR:gles2_cmd_decoder.cc(1773)] [.ChromiumCompositor-0x76d6bfc8]GL ERROR :GL_OUT_OF_MEMORY : GLES2DecoderImpl::PrepareTexturesForRender: <- error from previous GL command |
AndroidManifestでWebViewを使 … 続きを読む
WebViewの終了処理
ログにエラーがつらつらと出てくるので。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
web.stopLoading(); web.clearCache(true); web.clearHistory(); try { Thread.sleep(100); } catch(Exception e) { e.printStackTrace(); } web.setWebChromeClient(null); web.setWebViewClient(null); unregisterForContextMenu(web); web.destroy(); web = null; |
キャッシュクリア後sleepしないとクリアされない模様。 参考