0

I'm preparing an application it's 50% Native 50% Webview. Some users doesn't know how to paste from clipboard on mobile that's why I wanna make an button and user when click this button, it's must paste from clipboard to input. Javascript or Android or PHP I need.

Can you help me about it?

1 Answers1

0
CharSequence pasteData="";
ClipData.Item item = clipboard.getPrimaryClip().getItemAt(0);
pasteData = item.getText();

Then use the pasteData.

As you want to give it to the web, use the message transport from java to javascript. See this: How to call javascript from Android?

Then you only need to send the pasteData to js, use js to change the data of the input.

(If you find it helpful, please mark this as the accepted answer.)

ch271828n
  • 15,854
  • 5
  • 53
  • 88
  • Do you know how I can use this in webview input? –  Jun 11 '17 at 08:22
  • I didn't understand nothing really. I'm beginner about android. Please write some code for me I paste it in my activity :D I have just one input in my webview and I wanna put a button "Paste" and when user click it it's must paste in the input :) –  Jun 11 '17 at 08:35
  • er, i am a little busy these days... and you maybe cannot expect everyone in stackoverflow gives you detailed answer which you can directly *copy and paste to your project*... – ch271828n Jun 11 '17 at 08:42
  • I try to search more then. Thanks. –  Jun 11 '17 at 08:43
  • You are welcome. If I have time I will write it for you. – ch271828n Jun 11 '17 at 08:43
  • I'll be happy if you'll do it. –  Jun 11 '17 at 08:55