android--------解決Entities and POJOs must have a usable public constructor


     今天在學習android數據庫,運行程序的時候報錯,錯誤是:Entities and POJOs must have a usable public constructor. You can have an empty constructor or a constructor whose parameters match the fields (by name and type).Tried the following constructors but they failed to match:

Word(java.lang.String,java.lang.String) -> [param:english_word -> matched field:unmatched, param:chinese_meaning -> matched field:unmatched]。

   解決方法:在實體類寫一個空的構造函數即可。

  因為我有一個有參的構造函數,於是我寫了一個空的構造函數即可運行。

  

 

   寫一個空的構造函數:

 

 

 

 

 

  運行成功:

 

  

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM