@Override public boolean onLongClick(View v) { mClipBoard = new Clipboard(getActivity()); mClipBoard.copyText(mPassword.getText().toString()); ShowToast.showToast(getActivity(), getString(R.string.password_copied_to_clipboard)); return true; }
public void showTip() { SharedPreferences sharedPreferences = getActivity().getSharedPreferences(MyConfigs.PREFS_NAME, 0); int result = sharedPreferences.getInt(MyConfigs.FIRST_ITEM_DESCRIPTION_OPENED, 0); if (result == 0) { ShowToast.showToast( getActivity(), getActivity().getString(R.string.tap_and_hold_on_the_password_to_copy_it_)); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.putInt(MyConfigs.FIRST_ITEM_DESCRIPTION_OPENED, 1).commit(); } }