Code example for ClipboardManager

Methods: getTexthasText

0
	public void onCreate() { 
		// TODO Auto-generated method stub 
		super.onCreate(); 
		ClipboardManager clipman= (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
		 
		if(clipman.hasText()){
			Toast.makeText(	getApplicationContext(),clipman.getText().toString(),Toast.LENGTH_LONG).show();
		} 
		else {Toast.makeText(getApplicationContext(),"No text",Toast.LENGTH_LONG).show();}
		stopSelf();
		 
	} 
 
	 
		@Override 
		public void onDestroy() { 
			//Toast.makeText(this, "My Service Stopped", Toast.LENGTH_LONG).show(); 
		}