InflateException with TextInputLayout and AlertDialog

前端 未结 7 611
被撕碎了的回忆
被撕碎了的回忆 2020-12-11 05:55

I am trying to use the newest TextInputLayout in my DialogFragment.

Here\'s my code:



        
7条回答
  •  攒了一身酷
    2020-12-11 06:24

    I experienced this error but it ended up being a completely different context. I didn't see my exact issue outlined elsewhere so posting an answer here hoping it will save others time. In my case, this exception was thrown:

    android.view.InflateException: Binary XML file line #1: Error inflating class android.support.design.widget.TextInputLayout
    

    However, it was related to the implementation for the FileProvider camera permissions. That implementation involved adding an xml file under Resources/xml.

    Having anything in the Resources/xml folder would throw the exception. Both FileProvider and TextInputLayout worked independently but not when used in the same project.

    The result that worked for me was to move all xml files from Resource/xml to Resources/layout and reference them with @layout/my_reference_here.

    This seems like a bug in Visual Studio/Xamarin, but at least I was able to move forward. I hope this helps another avoid burning a couple of days of time hunting it down.

提交回复
热议问题