void copyPassToClipboard() { try { Password pw = new Password(new URL(url), mPasswordView.getText().toString()); MyClipboardManager clipboard = new MyClipboardManager(); clipboard.copyToClipboard(this, pw.getPassword()); } catch (MalformedURLException e) { e.printStackTrace(); Toast.makeText(this, "Copying failed", Toast.LENGTH_LONG).show(); } }
@Override public Map<String, Credentials> apply(HttpResponse arg0) { Map<String, Credentials> serverNameToCredentials = Maps.newHashMap(); for (Password password : json.apply(arg0).getList()) { serverNameToCredentials.put( password.getServer().getName(), new Credentials(password.getUserName(), password.getPassword())); } return serverNameToCredentials; }