Recent

Author Topic: [Solved] LAMW - how to access the clipboard?  (Read 317 times)

wywong

  • New Member
  • *
  • Posts: 16
[Solved] LAMW - how to access the clipboard?
« on: April 08, 2020, 02:56:44 am »
I try to copy some text to the Android clipboard using the Windows way:

uses ClipBrd,...

ClipBoard.setTextbuf('Hello');

or
 
ClipBoard.asText := 'Hello';

Both build OK but both crash my app when testing on my smartphone. Is clipboard implemented? If so, how to use it?
« Last Edit: April 09, 2020, 03:08:56 pm by wywong »

jmpessoa

  • Hero Member
  • *****
  • Posts: 1511
Re: LAMW - how to access the clipboard?
« Reply #1 on: April 09, 2020, 03:05:14 am »

Some LAMW components has "build-in"  clipboard methods....
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

wywong

  • New Member
  • *
  • Posts: 16
Re: LAMW - how to access the clipboard?
« Reply #2 on: April 09, 2020, 02:03:50 pm »
Thanks jmpessoa. I tried the following code and it worked!

jTextView1.text := 'Hello'; jTextView1.copyToClipboard();

 

TinyPortal © 2005-2018