Try this...
Get the all text value inside ClickListener when application launch all the text are empty
btn.setOnClickListener(new OnClickListener() {
public void onClick(View arg0) {
final int startIndex = txt.getSelectionStart();
final int endIndex = txt.getSelectionEnd();
final String stringYouExtracted = txt.getText().toString().substring(startIndex, endIndex);
ClipboardManager clipboard = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
clipboard.setText(stringYouExtracted);
txt2.setText(stringYouExtracted);
}
});