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 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); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your example is so lousy that Line 9 states "conatiner" instead of "container".