Detect instead of assume Cursor field types.

This should avoid an IllegalStateException in this area.
diff --git a/lib/src/main/java/com/artifex/mupdf/viewer/DocumentActivity.java b/lib/src/main/java/com/artifex/mupdf/viewer/DocumentActivity.java
index 8125872..5a68723 100644
--- a/lib/src/main/java/com/artifex/mupdf/viewer/DocumentActivity.java
+++ b/lib/src/main/java/com/artifex/mupdf/viewer/DocumentActivity.java
@@ -220,8 +220,16 @@
 				cursor = getContentResolver().query(uri, null, null, null, null);
 				if (cursor != null && cursor.moveToFirst()) {
 					try {
-						mDocTitle = cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
-						size = cursor.getLong(cursor.getColumnIndex(OpenableColumns.SIZE));
+						int idx;
+
+						idx = cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME);
+						if (idx >= 0 && cursor.getType(idx) == Cursor.FIELD_TYPE_STRING)
+							mDocTitle = cursor.getString(idx);
+
+						idx = cursor.getColumnIndex(OpenableColumns.SIZE);
+						if (idx >= 0 && cursor.getType(idx) == Cursor.FIELD_TYPE_INTEGER)
+							size = cursor.getLong(idx);
+
 						if (size == 0)
 							size = -1;
 					} finally {