Android/Java - Issue
The code is like this:
private DatabaseHelper mOpenHelper;
@Override
public boolean onCreate() {
mOpenHelper = new DatabaseHelper(getContext());
System.out.println("done");
return true;
}
Now Eclipse is showing me an error warning on the first line of this code "private DatabaseHelper mOpenHelper", that the object mOpenHelp开发者_运维知识库er is not used anywhere, whereas in the very next lines of code, I am initializing it. Please tell me why is this happening?
Thanks,
-DYes eclipse is right, You have initialized it and not using it anywhere. It would not complain if you use that mOpenHelper say in a getter method.
The warning doesn't say not be USED anyone, it's saying not being READ anywhere. And it's not. You're declaring it, assigning it, but not reading it.
精彩评论