tags:

views:

117

answers:

2

The code is like this:

private DatabaseHelper mOpenHelper;
    @Override
    public boolean onCreate() {
        mOpenHelper = new DatabaseHelper(getContext());
        System.out.println("done");
        return true;
    }

Now ecliplse is showing me an error warning on the first line of this code "private DatabaseHelper mOpenHelper", that the object mOpenHelper is not used anywhere, whereas in the very next lines of code, I am initializing it. Please tell me why is this happening?

Thanks,

-D

+10  A: 

Yes eclipse is right, You have initialized it and are not using it anywhere. It would not complain if you use that mOpenHelper say in a getter method.

Bragboy
+1  A: 

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.

Falmarri