APIdia Launch Partner
Top Description Methods
com.badlogic.gdx.utils

public Interface Clipboard


A very simple clipboard interface for text content.
Author
mzechner

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the clipboard content or null
getContents
()

gets the current content of the clipboard if it contains text for WebGL app, getting the system clipboard is currently not supported.

public boolean

Returns:

true, if the clipboard has contents
hasContents
()

Check if the clipboard has contents.

public void
setContents(String
the content
content
)

Sets the content of the system clipboard.

Method Detail

getContentsback to summary
public String getContents()

gets the current content of the clipboard if it contains text for WebGL app, getting the system clipboard is currently not supported. It works only inside the app

Returns:String

the clipboard content or null

hasContentsback to summary
public boolean hasContents()

Check if the clipboard has contents. Recommended to use over getContents() for privacy reasons, if you only want to check if there's something on the clipboard. For instance, calling getContents() on iOS shows a privacy notification since iOS 14, while hasContents() does not.

Returns:boolean

true, if the clipboard has contents

setContentsback to summary
public void setContents(String content)

Sets the content of the system clipboard. for WebGL app, clipboard content might not be set if user denied permission, setting clipboard is not synchronous so you can't rely on getting same content just after setting it

Parameters
content:String

the content