@Override
public void onFolderSelection(@NonNull FolderChooserDialog dialog, @NonNull File directory) {
String tag = dialog.getTag();
switch(tag) {
case SettingsFragment.FOLDER_CHOOSER_TAG:
if (directory.canWrite()) {
CheckPreferences.setDownloadLocation(this, directory.getPath());
SettingsFragment.updatePreferenceSummary();
} else {
Toast.makeText(this, R.string.unable_to_select_sd_card, Toast.LENGTH_LONG).show();
ApplicationLogMaintainer.sendBroadcast(this, "Unable to write on selected directory :");
ApplicationLogMaintainer.sendBroadcast(this, directory.getAbsolutePath());
}
break;
case DownloadOptionAdapter.FOLDER_CHOOSER_TAG:
if (directory.canWrite()) {
DownloadOptionAdapter downloadOptionAdapter =
(DownloadOptionAdapter) mDownloadDialogRecyclerView.getAdapter();
downloadOptionAdapter.setDownloadLocation(directory.getPath());
SettingsFragment.updatePreferenceSummary();
} else {
Toast.makeText(this, R.string.unable_to_select_sd_card, Toast.LENGTH_LONG).show();
ApplicationLogMaintainer.sendBroadcast(this, "Unable to write on selected directory :");
ApplicationLogMaintainer.sendBroadcast(this, directory.getAbsolutePath());
}
}
}
MainActivity.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:OneTapVideoDownload
作者:
评论列表
文章目录