When I compile the following code
cursor = activity.managedQuery( imageUri, proj, null, null, null );
I get following warning
The managedQuery method is deprecated, meaning it should no longer be used and there is an updated method available. The replacement for this is getContentResolver().query():
cursor = activity.getContentResolver().query(imageUri, proj, null, null, null);
You can normally find out why the method is deprecated, and what you should use instead, by a quick Google of the method name, or depending on how good the javadoc is it may inform you through your IDE.