Code example for ClipboardManager

Methods: setText

0
			buttonUnreg.setEnabled(true);
			//print out regID in log  
			Log.d(TAG, String.format("Reg Id: %s", regId));
			//Copy to clipboard 
			ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); 
			clipboard.setText(regId);
			//Notify user via Toast 
			Toast.makeText(this, "Registration ID copied to clipboard", Toast.LENGTH_LONG).show();
		} 
	} 
 
	 
	/** 
	 * @author liuisaac 
	 * This is our broadcast receiver class to receive intents that's sent from C2DMReceiver 
	 */ 
	class IdReceiver extends BroadcastReceiver {
		@Override 
		public void onReceive(Context context, Intent intent) {
			Log.d("IdReceiver", "onReceived");
			// Refresh the display if we receive an intent from C2DMReceiver