Search code examples
androidandroid-support-libraryandroid-appcompatandroid-textinputlayout

eclipse android textinputlayout cannot instantiate the class on designer, inflater error on runtime


how to properly use the textinputlayout? what has been tried are as follows:

  • import the appcompat project import as library, import the support design jar
  • import the appcomtap project import as library, import the support design project import as library.

both produced the error No 'id' attribute supplied <public>, and no previous id defined in this file. this files are from support design -> res-public -> public_attr, public_string and public_styles.

if I did not included them, it says like missing backgroundTint.

the manifest file uses sdk min 11, target version is 22. the appcompat and support design is also 22 (tried 23 for all of them non worked).

also updated the support library to latest

what is the correct steps?


Solution

  • found the answer, just follow the steps provided by the answer marked as correct. steps to properly use android design support library

    • basically just import the app compat v7 targeting the latest api
    • then create an android project for design support and place all files of the design support library and then add the app compat v7 library to the newly created android project (design support)
    • you can then use this project marked as library to any project that needs this design support library (just make sure the app theme uses the Theme.AppCompat.Light.DarkActionBar at least to make it work)