Hmm... Not sure...
in line 22
private final Context myContext;
You put "final" to your myContext variable but then you attempt to assign a value to it in the constructor???
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 376
Skill Endorsements: 17
@Taywin: You're allowed to initialize a final instance variable like that in the constructor one time. You cannot make further assignments to it though.
Ezzaral
null
16,126 posts since May 2007
Reputation Points: 3,294
Solved Threads: 875
Skill Endorsements: 28
Oh thank you for clarification :) Then I need to loop further in the code :)
OK, back to the last code portion at line 9 & 10
//syntax token error ";" in the below line
DataBaseHelper myDbHelper = new DataBaseHelper(null);
myDbHelper = new DataBaseHelper(this);
Why do you create "new" once, and then try the second time? The second one, however, use "this" which is the "VarbClass" class. I thought your constructor require "Context" class? Does "VerbClass" has any relation with "Context" class at all?
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 376
Skill Endorsements: 17
There is no DataBaseHelper constructor, therefore error.
PS: As Taywin pointed out assignment part of line 9 new DataBaseHelper(null) should be replaced by new DataBaseHelper(CONTEXT); .
PS2: You can have look at this sample I put on github few weeks back. It is from Pro Android 3 book
peter_budo
Code tags enforcer
15,812 posts since Dec 2004
Reputation Points: 2,871
Solved Threads: 944
Skill Endorsements: 52
Question Answered as of 1 Year Ago by
Taywin,
peter_budo
and
Ezzaral