user1516894
user1516894

Reputation: 11

Copy paste via notification bar in Android

Have you seen these password managers like Lastpass ? They allow you to copy-paste via Notification bar in Android. Typically, the sequence is like this..

  1. User in Lastpass presses a button, that puts two notifications in Notification Bar.
  2. User switches to any other application say a browser and when he has to insert username and password
  3. He opens notification bar, selecting the notifications from Lastpass pastes the username or password into the textfield of the browser.

Can anyone break this down into steps and guide me how I can implement this kind of a structure...

Thanks

Upvotes: 1

Views: 1087

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007296

Step #1: Raise a Notification, with a getBroadcast() PendingIntent pointing to a BroadcastReceiver of yours.

Step #2: In that BroadcastReceiver, copy the data to the clipboard using ClipboardManager.

Upvotes: 1

Related Questions