Created
October 25, 2013 14:23
-
-
Save mombrea/7155462 to your computer and use it in GitHub Desktop.
Example of copying a textview in android on a button click
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void btnCopyClicked(View view){ | |
| LinearLayout container = (LinearLayout)view.findViewById(R.id.container_id); | |
| TextView txt1 = (TextView)view.findViewById(R.id.txtView_id); | |
| TextView txt2 = new TextView(this); //this = context | |
| txt2.setText(txt1.getText()); | |
| conatiner.addView(txt2); | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@pbochan what would you change aside from the typo? Also, nice website http://pbochan.com/