Check for null when retrieving clip data item text on Android
This commit is contained in:
parent
504708ae21
commit
5924e2b90e
|
@ -663,14 +663,13 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getClipboard() {
|
public String getClipboard() {
|
||||||
String copiedText = "";
|
ClipData clipData = mClipboard.getPrimaryClip();
|
||||||
|
if (clipData == null)
|
||||||
if (mClipboard.hasPrimaryClip()) {
|
return "";
|
||||||
ClipData.Item item = mClipboard.getPrimaryClip().getItemAt(0);
|
CharSequence text = clipData.getItemAt(0).getText();
|
||||||
copiedText = item.getText().toString();
|
if (text == null)
|
||||||
}
|
return "";
|
||||||
|
return text.toString();
|
||||||
return copiedText;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setClipboard(String p_text) {
|
public void setClipboard(String p_text) {
|
||||||
|
|
Loading…
Reference in New Issue