The way to go is to request the file with a mime type of "/" and then and let show yourself the meta fields of the returned URI. As it turns out a ".key" file has a mime-type of "application/x-iwork-keynote-sffkey"
A quick&dirty method is given here:
@Override
public void onActivityResult(int requestCode, int resultCode,
Intent resultData) {
if (requestCode == READ_REQUEST_CODE && resultCode == Activity.RESULT_OK) {
Uri uri = null;
if (resultData != null) {
uri = resultData.getData();
Log.i(TAG, "Uri: " + uri.toString());
Cursor c = getActivity().getContentResolver().query(uri, null, null, null, null);
try {
String r = "";
c.moveToFirst();
do {
for (int i = 0; i < c.getColumnCount(); i++) {
r += c.getColumnName(i) + " " + c.getString(i) + "\n";
}
r += "\n";
} while (c.moveToNext());
mResultView.setText(r);
} finally {
c.close();
}
}
}
}