Copy paste via notification bar in Android

2019-08-14 03:18发布

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

1条回答
迷人小祖宗
2楼-- · 2019-08-14 03:29

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.

查看更多
登录 后发表回答