I want to be able to access a word file in the sdcard of the user\'s phone, and the file will be chosen by the user. I want to be able to process the file, i.e. read its con
so, as i write above. The simpliest way to check if it's word-file (.doc) is to get it's absolute path and check it with path.endsWith(".doc");
Android doesn't have default app to view .doc-files, but if user has installed such an app (i.e. Polaris Office), you can view it in this way:
//Uri uri = Uri.parse("file://"+file.getAbsolutePath());
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(Intent.ACTION_VIEW);
String type = "application/msword";
intent.setDataAndType(Uri.fromFile(file), type);
startActivity(intent);