Error inflating class ImageView

前端 未结 17 2396
失恋的感觉
失恋的感觉 2020-12-29 21:01

I\'ve been getting InflateException/ClassNotFoundException error intermittently. I\'ve seen similar errors before in SO but they were caused by spelling errors. I spelled \'

17条回答
  •  执念已碎
    2020-12-29 21:56

    you haven't closed LinearLayout tag

    and please use following code for inflating layout.xml

    LayoutInflater inflater = getLayoutInflater();
    final View v = inflater.inflate(R.layout.your_layout_id, null);
    

提交回复
热议问题