why cursor is null?
<pre><code> public static String getRealPathFromURI(Activity activity,Uri contentUri) {
        String[] proj = { MediaStore.Images.Media.DATA };
        Cursor cursor = activity.managedQuery(contentUri, proj, null, null, null);
        int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
        cursor.moveToFirst();
        return cursor.getString(column_index);
    }
</code></pre>

<p>I have two android device HTC Wildfire s and HTC Desire Z. When I run in Wildfire s it is works fine but when I run in Desizre Z I have NullPointer exception. I checked with debugging and find out that cursor is null. What is the problem here? Any help please?</p>
