Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resources$NotFoundException: Resource ID #0x0 #35

Closed
wangxj opened this issue Feb 26, 2016 · 3 comments
Closed

Resources$NotFoundException: Resource ID #0x0 #35

wangxj opened this issue Feb 26, 2016 · 3 comments

Comments

@wangxj
Copy link

wangxj commented Feb 26, 2016

android.content.res.Resources$NotFoundException: Resource ID #0x0
at android.content.res.Resources.getValue(Resources.java:1981)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:3187)
at android.content.res.Resources.getLayout(Resources.java:1797)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.databinding.DataBindingUtil.inflate(DataBindingUtil.java:116)
at android.databinding.DataBindingUtil.inflate(DataBindingUtil.java:88)
at com.common.bindingcollectionadapter.BindingRecyclerViewAdapter.onCreateBinding(BindingRecyclerViewAdapter.java:68)
at com.common.bindingcollectionadapter.BindingRecyclerViewAdapter.onCreateViewHolder(BindingRecyclerViewAdapter.java:107)
at com.common.bindingcollectionadapter.BindingRecyclerViewAdapter.onCreateViewHolder(BindingRecyclerViewAdapter.java:24)
at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:4385)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:3700)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:3609)
at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1859)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1311)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1274)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:510)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2118)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:2415)
at android.view.View.layout(View.java:15204)
at android.view.ViewGroup.layout(ViewGroup.java:4793)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1076)
at android.view.View.layout(View.java:15204)
at android.view.ViewGroup.layout(ViewGroup.java:4793)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:15204)
at android.view.ViewGroup.layout(ViewGroup.java:4793)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:15204)
at android.view.ViewGroup.layout(ViewGroup.java:4793)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1076)
at android.view.View.layout(View.java:15204)
at android.view.ViewGroup.layout(ViewGroup.java:4793)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:15204)
at android.view.ViewGroup.layout(ViewGroup.java:4793)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1677)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1531)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1440)
at android.view.View.layout(View.java:15204)
at android.view.ViewGroup.layout(ViewGroup.java:4793)
at me.imid.swipebacklayout.lib.SwipeBackLayout.onLayout(SwipeBackLayout.java:386)
at android.view.View.layout(View.java:15204)
at android.view.ViewGroup.layout(ViewGroup.java:4793)
at android.widget.FrameLayout.onLayout(FrameLayout.java:448)
at android.view.View.layout(View.java:15204)
at android.view.ViewGroup.layout(ViewGroup.java:4793)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2257)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2004)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1246)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6350)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:791)
at android.view.Choreographer.doCallbacks(Choreographer.java:591)
at android.view.Choreographer.doFrame(Choreographer.java:561)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:777)
at android.os.Handler.handleCallback(Handler.java:730)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5454)

在使用三星,小米部分手机时,会出现两次调用BindingRecyclerViewAdapters中的setAdapter(RecyclerView recyclerView, ItemViewArg arg, List items)方法,第一次调用arg和item都为null,第二次调用才有正常参数。所以报以上错误。
所以我修改为
public static void setAdapter(RecyclerView recyclerView, ItemViewArg arg, List items) {
if (null == items || items.isEmpty()) return;
setAdapter(recyclerView, arg, items, BindingRecyclerViewAdapterFactory.DEFAULT, null);
}
就可以正常运行了。

In the use of the Samsung, xiaomi mobile phone, two calls to the BindingRecyclerViewAdapters, setAdapter(RecyclerView recyclerView, Arg ItemViewArg, List items)
the first call to Arg and item is null, the second call to the normal reference number. So the above error report.
So I changed to
Public static void setAdapter (RecyclerView recyclerView, ItemViewArg Arg, List items) {
If (null = = items items.isEmpty (return) ||);
SetAdapter (recyclerView, Arg, items, BindingRecyclerViewAdapterFactory.DEFAULT, null);
}
Can the normal operation.

@evant
Copy link
Owner

evant commented Feb 26, 2016

Please format your code with github's code blocks. I'm having a really hard time trying to figure out what's going on.

@evant
Copy link
Owner

evant commented Feb 26, 2016

I think you may have run your code through google translate, please don't do that. It makes it impossible to understand.

@evant
Copy link
Owner

evant commented Mar 19, 2016

Closing for lack of information, feel free to reopen if you are still having issues.

@evant evant closed this as completed Mar 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants