public boolean onItemSelected(MenuItem item) { int id = item.getItemId(); switch (id) { case R.id.menu_item_share: { /* Intent intent = new Intent(); intent.setAction(Intent.ACTION_SEND); intent.putExtra(Intent.EXTRA_TEXT, websiteUrl); intent.setType("text/plain"); activity.startActivity(Intent.createChooser(intent, activity.getString(R.string.share_dialog_title))); */ if (onShareListener != null) { onShareListener.onActionSelected(selectedVideoStream); } return true; } case R.id.menu_item_openInBrowser: { if (onOpenInBrowserListener != null) { onOpenInBrowserListener.onActionSelected(selectedVideoStream); } } return true; case R.id.menu_item_download: if (onDownloadListener != null) { onDownloadListener.onActionSelected(selectedVideoStream); } return true; case R.id.action_settings: { Intent intent = new Intent(activity, SettingsActivity.class); activity.startActivity(intent); return true; } case R.id.action_play_with_kodi: if (onPlayWithKodiListener != null) { onPlayWithKodiListener.onActionSelected(selectedVideoStream); } return true; case R.id.menu_item_play_audio: if (onPlayAudioListener != null) { onPlayAudioListener.onActionSelected(selectedVideoStream); } return true; case R.id.menu_item_downloads: { Intent intent = new Intent(activity, org.schabi.newpipe.download.MainActivity.class); activity.startActivity(intent); return true; } default: Log.e(TAG, "Menu Item not known"); } return false; }
@Override public void onClick(View v) { if (v == mBtnCreateIdentity) { if (mListener != null && mEditAuthorName.getText().length() > 0) mListener.onCreateIdentity(mEditAuthorName.getText().toString()); } }
public void clearSearch() { inputSearch.setOnActionListener(null); inputSearch.setText(""); inputSearch.setOnActionListener(inputSearchListener); listener.onClear(); }
protected void onFilter(String str) { if (listener != null) { listener.onFilter(this, str); } }
protected void onCheckAll(boolean isChecked) { if (listener != null) { listener.onCheckAll(this, isChecked); } }
@Override public void performAction() { listener.onAction(); }