本文整理匯總了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();
}