本文整理汇总了Java中org.videolan.vlc.gui.browser.FilePickerActivity类的典型用法代码示例。如果您正苦于以下问题:Java FilePickerActivity类的具体用法?Java FilePickerActivity怎么用?Java FilePickerActivity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
FilePickerActivity类属于org.videolan.vlc.gui.browser包,在下文中一共展示了FilePickerActivity类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onAudioSubClick
import org.videolan.vlc.gui.browser.FilePickerActivity; //导入依赖的package包/类
public void onAudioSubClick(View anchor){
final AppCompatActivity context = this;
PopupMenu popupMenu = new PopupMenu(this, anchor);
popupMenu.getMenuInflater().inflate(R.menu.audiosub_tracks, popupMenu.getMenu());
popupMenu.getMenu().findItem(R.id.video_menu_audio_track).setEnabled(mService.getAudioTracksCount() > 0);
popupMenu.getMenu().findItem(R.id.video_menu_subtitles).setEnabled(mService.getSpuTracksCount() > 0);
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
if (item.getItemId() == R.id.video_menu_audio_track) {
selectAudioTrack();
return true;
} else if (item.getItemId() == R.id.video_menu_subtitles) {
selectSubtitles();
return true;
} else if (item.getItemId() == R.id.video_menu_subtitles_picker) {
if (mUri == null)
return false;
Intent filePickerIntent = new Intent(context, FilePickerActivity.class);
if (TextUtils.equals(mUri.getScheme(), "file"))
filePickerIntent.setData(Uri.parse(Strings.getParent(mUri.toString())));
context.startActivityForResult(filePickerIntent, 0);
return true;
}
return false;
}
});
popupMenu.show();
}