Cellojaan Cellojaan -4 years ago 99
Android Question

Paste from clipboard to input? - PHP or ANDROID

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?

Answer Source
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.)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download