Android Question B4A: Error location

grafsoft

Well-Known Member
Licensed User
Longtime User
I get the following error:

"An error has occured in sub:contacts_activity_create (java line: 457) java.lang.RuntimeException: Object should first be initialized (Cursor) Continue?"

But at line 457 therre is no object one could initialize.

Furthermore, I am initializing all the objects that are used by more than 1 activity in aa funkction that is called at the creation of each activity

B4X:
' example
If Main.locale.Initialized=False Then Main.locale.Initialize
 

Attachments

  • contacts.zip
    8.2 KB · Views: 135

JonPM

Well-Known Member
Licensed User
Longtime User
You didn't attach the correct zip file. In B4A use File > Export as Zip.

Are you sure your database file is included in your project, and the filename is being called correctly? Also are you sure your db isn't empty?
 
Upvote 0

grafsoft

Well-Known Member
Licensed User
Longtime User
Maybe I solved it. I hat the line "Dim cr as cursor" twice - in a very seldom situation. But I will check with my tester tomorrow and see if the issue is solved.

The database issue is correct.

We will see, but thank you.
 
Upvote 0

Hilton

Active Member
Licensed User
Longtime User
Maybe I solved it. I hat the line "Dim cr as cursor" twice - in a very seldom situation. But I will check with my tester tomorrow and see if the issue is solved.

The database issue is correct.

We will see, but thank you.

Hi,
You can also get that error if you try to use the resultset(cursor) without having accessed the database yet. That is in spite of having a dim for the cursor.

Hilton.
 
Upvote 0
Top