CRUD: List Method

Asked

Viewed 62 times

-3

Good evening, I am learning about CRUD in my mobile programming course, we are programming in a database Sqlite, as the project is not yet ready for reasons of the teacher himself, to check if the database works, We are putting the data in the first screen that appears in the app (in this case the presentation screen) to load and so the data already be recorded, but as shown in the image, is giving error obj and I can not understand why. Only from error if it is obj, anything else written not from error. I already compared the project with the teacher’s project, I did not find the problem, which may be?

erro obj

  • 1

    Please transfer the image code to facilitate the solution of your question.

1 answer

1


You have error in this line because you are already instantiating a variable of the Mediaschool type on line 33 and therefore in the cycle for you should use another name. Try for example like this and see the result:

for(MediaEscolar media : objectos){
Log.d( "Matéria : " + media.getMateria() + " Semestre : " + media.getBimestre() + " Media :" + media.getMediaFinal())
}
  • Actually, I deleted the data from line 33 and at the bottom cycle accepted the name. The way is to put another name then. Thanks for the help :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.