SettingsActivity.java 文件源码

java
阅读 20 收藏 0 点赞 0 评论 0

项目:Minerva 作者:
/**
 * Click handler for the library directory preference.
 * @param preference The actual preference.
 * @return Always {@code true}, since we always handle the click.
 */
private boolean onLibDirPrefClick(Preference preference) {
    if (!Util.checkForStoragePermAndFireEventIfNeeded(R.id.action_choose_lib_dir)) return true;

    // Set up most of dialog. Our SettingsActivity is the only possible host for this fragment.
    FolderChooserDialog.Builder builder = new FolderChooserDialog.Builder((SettingsActivity) getActivity())
            .chooseButton(R.string.ok)
            .cancelButton(R.string.cancel);

    // Check to see if the current value is a valid folder.
    String folderPath = prefs.getLibDir(null);
    if (folderPath != null && new File(folderPath).exists()) builder.initialPath(folderPath);

    // Show the folder chooser dialog.
    builder.show();
    return true;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号