溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

ViewPager手動創(chuàng)建中的問題

發(fā)布時間:2020-05-03 07:57:14 來源:網(wǎng)絡(luò) 閱讀:766 作者:zhylandroid 欄目:移動開發(fā)

-12 23:29:41.202: E/AndroidRuntime(1850): FATAL EXCEPTION: main

03-12 23:29:41.202:


E/AndroidRuntime(1850): android.content.res.Resources$NotFoundException: Unable to find resource


ID #0xffffffff

03-12 23:29:41.202: E/AndroidRuntime(1850): at


android.content.res.Resources.getResourceName(Resources.java:1775)

03-12 23:29:41.202:


E/AndroidRuntime(1850): at android.support.v4.app.FragmentManagerImpl.moveToState


(FragmentManager.java:919)

03-12 23:29:41.202: E/AndroidRuntime(1850): at


android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)

03-12


23:29:41.202: E/AndroidRuntime(1850): at android.support.v4.app.BackStackRecord.run


(BackStackRecord.java:682)

03-12 23:29:41.202: E/AndroidRuntime(1850): at


android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)

03-12


23:29:41.202: E/AndroidRuntime(1850): at


android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:472)

03-12 23:29:41.202: E/AndroidRuntime(1850): at


android.support.v4.app.FragmentPagerAdapter.finishUpdate(FragmentPagerAdapter.java:141)

03-12


23:29:41.202: E/AndroidRuntime(1850): at android.support.v4.view.ViewPager.populate


(ViewPager.java:1068)

03-12 23:29:41.202: E/AndroidRuntime(1850): at


android.support.v4.view.ViewPager.populate(ViewPager.java:914)

03-12 23:29:41.202:


E/AndroidRuntime(1850): at android.support.v4.view.ViewPager.onMeasure


(ViewPager.java:1436)

03-12 23:29:41.202: E/AndroidRuntime(1850): at


android.view.View.measure(View.java:15848)

03-12 23:29:41.202: E/AndroidRuntime(1850): at


android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5012)

03-12 23:29:41.202:


E/AndroidRuntime(1850): at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)

03-


12 23:29:41.202: E/AndroidRuntime(1850): at android.view.View.measure(View.java:15848)

03-


12 23:29:41.202: E/AndroidRuntime(1850): at android.widget.LinearLayout.measureHorizontal


(LinearLayout.java:1034)

03-12 23:29:41.202: E/AndroidRuntime(1850): at


android.widget.LinearLayout.onMeasure(LinearLayout.java:590)

03-12 23:29:41.202: E/AndroidRuntime


(1850): at android.view.View.measure(View.java:15848)

03-12 23:29:41.202:


E/AndroidRuntime(1850): at android.view.ViewGroup.measureChildWithMargins


(ViewGroup.java:5012)

03-12 23:29:41.202: E/AndroidRuntime(1850): at


android.widget.FrameLayout.onMeasure(FrameLayout.java:310)

03-12 23:29:41.202: E/AndroidRuntime


(1850): at android.view.View.measure(View.java:15848)

03-12 23:29:41.202:


E/AndroidRuntime(1850): at android.view.ViewGroup.measureChildWithMargins


(ViewGroup.java:5012)

03-12 23:29:41.202: E/AndroidRuntime(1850): at


com.android.internal.widget.ActionBarOverlayLayout.onMeasure(ActionBarOverlayLayout.java:302)

03-


12 23:29:41.202: E/AndroidRuntime(1850): at android.view.View.measure(View.java:15848)

03-


12 23:29:41.202: E/AndroidRuntime(1850): at android.view.ViewGroup.measureChildWithMargins


(ViewGroup.java:5012)

03-12 23:29:41.202: E/AndroidRuntime(1850): at


android.widget.FrameLayout.onMeasure(FrameLayout.java:310)

03-12 23:29:41.202: E/AndroidRuntime


(1850): at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure


(PhoneWindow.java:2189)

03-12 23:29:41.202: E/AndroidRuntime(1850): at


android.view.View.measure(View.java:15848)

03-12 23:29:41.202: E/AndroidRuntime(1850): at


android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1905)

03-12 23:29:41.202:


E/AndroidRuntime(1850): at android.view.ViewRootImpl.measureHierarchy


(ViewRootImpl.java:1104)

03-12 23:29:41.202: E/AndroidRuntime(1850): at


android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1284)

03-12 23:29:41.202:


E/AndroidRuntime(1850): at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1004)

03-12 23:29:41.202: E/AndroidRuntime(1850): at


android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5481)

03-12 23:29:41.202:


E/AndroidRuntime(1850): at android.view.Choreographer$CallbackRecord.run


(Choreographer.java:749)

03-12 23:29:41.202: E/AndroidRuntime(1850): at


android.view.Choreographer.doCallbacks(Choreographer.java:562)

03-12 23:29:41.202:


E/AndroidRuntime(1850): at android.view.Choreographer.doFrame(Choreographer.java:532)

03-


12 23:29:41.202: E/AndroidRuntime(1850): at


android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)

03-12


23:29:41.202: E/AndroidRuntime(1850): at android.os.Handler.handleCallback(Handler.java:730)

03


-12 23:29:41.202: E/AndroidRuntime(1850): at android.os.Handler.dispatchMessage


(Handler.java:92)

03-12 23:29:41.202: E/AndroidRuntime(1850): at android.os.Looper.loop


(Looper.java:137)

03-12 23:29:41.202: E/AndroidRuntime(1850): at


android.app.ActivityThread.main(ActivityThread.java:5103)

03-12 23:29:41.202: E/AndroidRuntime


(1850): at java.lang.reflect.Method.invokeNative(Native Method)

03-12 23:29:41.202:


E/AndroidRuntime(1850): at java.lang.reflect.Method.invoke(Method.java:525)

03-12


23:29:41.202: E/AndroidRuntime(1850): at


com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)

03-12


23:29:41.202: E/AndroidRuntime(1850): at com.android.internal.os.ZygoteInit.main


(ZygoteInit.java:553)

03-12 23:29:41.202: E/AndroidRuntime(1850): at


dalvik.system.NativeStart.main(Native Method)




只需要對viewPager添加id值就可以,如viewPager.setId(任意值);


向AI問一下細節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI