Resources NotFoundException when trying to inflate a layout

1

Good day.

I have an activity in which I fill listview by means of an adapter, in lollipop it works perfect but in marshmallow and jellybean I get this exception

  

android.content.res.Resources $ NotFoundException: Resource ID # 0x7f04006f

the line on which it fails is this

 View v = inflater.inflate(R.layout.item_resident_dispense, parent, false);

Why does this happen? Thank you in advance.

    
asked by devjav 21.04.2017 в 19:15
source

1 answer

0

Generally the reason is that the file item_resident_dispense.xml does not exist therefore it can not generate an Id inside the file R.java

  

android.content.res.Resources $ NotFoundException: Resource ID # 0x7f04006f

an element within item_resident_dispense.xml does not exist or you are performing setText() to an integer value!

Another reason is that the R.java file containing the references of the elements within the project for some reason is not created correctly, you can perform Clean > Build and try again.

    
answered by 21.04.2017 в 19:24