Code example for ClipboardManager

Methods: getTexthasText

0
    private void performSpeak() { 
    	android.util.Log.d("VIJAY", "Perform Speak +");
    	mTv1.setText("Checking Clipboard...");
    	ClipboardManager clipboardManager = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
 
    	android.util.Log.d(TAG,"clipboardManager.hasText():" + clipboardManager.hasText());
    	 
    	if (clipboardManager.hasText()) {
	    	//Toast.makeText(getApplicationContext(),"Clipboard Text = "+ clipboardManager.getText().toString(), Toast.LENGTH_LONG).show(); 
	    	//clipboardManager.setText(null); 
	    	 
	    	strToSpeak = clipboardManager.getText().toString();
	    	//Log.d(TAG, "Calling sayHello 1"); 
	    	//sayHello(); 
    	} else { 
	    	Toast.makeText(getApplicationContext(), "No Content in Clipboard. So set some text in clipboard", Toast.LENGTH_LONG).show();
	    	//clipboardManager.setText("AndroidPeople.com"); 
	    	//Toast.makeText(getApplicationContext(), "Clipboard Text = " + clipboardManager.getText().toString(), Toast.LENGTH_LONG).show(); 
    	} 
    	android.util.Log.d("VIJAY", "Perform Speak -");
Connect your IDE to all the code out there  Get Codota for Java