try mContext = this;

That would then be an activity context, not an application context. Although it might work for the case required (I doubt it - see below), there are reasons for using one over the other.

http://android-developers.blogspot.co.uk/2009/01/avoiding-memory-leaks.html


It also doesn't help solve the problem of why the OP is getting a NullPointerException when trying to use the context they collected (if that is the actual problem they are getting).

Note the first line of the second paragraph:
http://developer.android.com/guide/topics/providers/content-providers.html

"When you want to access data in a content provider, you use the ContentResolver object in your *application's* Context"


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to