のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

[android]こんな書き方できるんだ。 mTextView.post

ViewクラスにPost関数があるのか調べたら、ありました。

   10428     public boolean post(Runnable action) {
   10429         final AttachInfo attachInfo = mAttachInfo;
   10430         if (attachInfo != null) {
   10431             return attachInfo.mHandler.post(action);
   10432         }
   10433         // Assume that post will succeed later
   10434         ViewRootImpl.getRunQueue().post(action);
   10435         return true;
   10436     }

[android]CalledFromWrongThreadException

シングルスレッドのチェック

   4605     void checkThread() {
   4606         if (mThread != Thread.currentThread()) {
   4607             throw new CalledFromWrongThreadException(
   4608                     "Only the original thread that created a view hierarchy can touch its views.");
   4609         }
   4610     }

NEW_PICTURE_MSG_ID

   2248     private void webkitDraw(DrawData draw) {
   2249         if (mWebViewClassic != null) {
   2250             draw.mFocusSizeChanged = nativeFocusBoundsChanged(mNativeClass);
   2251             draw.mViewSize = new Point(mCurrentViewWidth, mCurrentViewHeight);
   2252             if (mSettings.getUseWideViewPort()) {
   2253                 draw.mMinPrefWidth = Math.max(
   2254                         mViewportWidth == -1 ? WebViewClassic.DEFAULT_VIEWPORT_WIDTH
   2255                                 : (mViewportWidth == 0 ? mCurrentViewWidth
   2256                                         : mViewportWidth),
   2257                         nativeGetContentMinPrefWidth(mNativeClass));
   2258             }
   2259             if (mInitialViewState != null) {
   2260                 draw.mViewState = mInitialViewState;
   2261                 mInitialViewState = null;
   2262             }
   2263             if (mFirstLayoutForNonStandardLoad) {
   2264                 draw.mFirstLayoutForNonStandardLoad = true;
   2265                 mFirstLayoutForNonStandardLoad = false;
   2266             }
   2267             if (DebugFlags.WEB_VIEW_CORE) Log.v(LOGTAG, "webkitDraw NEW_PICTURE_MSG_ID");
   2268             pauseWebKitDraw();
   2269             Message.obtain(mWebViewClassic.mPrivateHandler,
   2270                     WebViewClassic.NEW_PICTURE_MSG_ID, draw).sendToTarget();
   2271         }
   2272     }

[android][webkit]DebugFlags

WEB_VIEW_CORE=ture
に書き直して、リビルドするとLOGが見れるようになった。

     28 class DebugFlags {
     29 
     30     public static final boolean BROWSER_FRAME = false;
     31     public static final boolean CACHE_MANAGER = false;
     32     public static final boolean CALLBACK_PROXY = false;
     33     public static final boolean COOKIE_MANAGER = false;
     34     public static final boolean COOKIE_SYNC_MANAGER = false;
     35     public static final boolean FRAME_LOADER = false;
     36     public static final boolean J_WEB_CORE_JAVA_BRIDGE = false;// HIGHLY VERBOSE
     37     public static final boolean LOAD_LISTENER = false;
     38     public static final boolean NETWORK = false;
     39     public static final boolean SSL_ERROR_HANDLER = false;
     40     public static final boolean STREAM_LOADER = false;
     41     public static final boolean URL_UTIL = false;
     42     public static final boolean WEB_BACK_FORWARD_LIST = false;
     43     public static final boolean WEB_SETTINGS = false;
     44     public static final boolean WEB_SYNC_MANAGER = false;
     45     public static final boolean WEB_VIEW = false;
     46     public static final boolean WEB_VIEW_CORE = false;
     47     public static final boolean MEASURE_PAGE_SWAP_FPS = false;
     48 }