Java tutorial
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.preference.PreferenceManager; import android.text.TextUtils; public class Main { private static final String DEFAULT_VIEWER_PREFIX = "default_viewer_"; public static boolean hasDefaultViewer(Context context, String mimeType) { if (!TextUtils.isEmpty(mimeType)) { return PreferenceManager.getDefaultSharedPreferences(context) .contains(DEFAULT_VIEWER_PREFIX + mimeType); } return false; } }