Java tutorial
//package com.java2s; import android.text.ClipboardManager; public class Main { private final static String initializeErrorString = "Class has not been initialized\nYou need to call ClipboardHelper.Initialize(context) first."; private static ClipboardManager clipboardManager; public static CharSequence getText() { if (clipboardManager == null) throw new NullPointerException(initializeErrorString); return clipboardManager.getText(); } }