Android TextInputField Inflator Error

后端 未结 13 1320
野的像风
野的像风 2020-12-03 06:55

Had a crash while trying to use the new TextInputField for Android and wanted to share my solution.

Trying the new TextInputField in the android appcomp

13条回答
  •  暖寄归人
    2020-12-03 07:26

    Make sure the LayoutInflater is created from an AppCompatActivity

    ex.

    instead of

    inflater = (LayoutInflater)ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    

    use:

    inflater = LayoutInflater.from();
    

提交回复
热议问题