Setting text to a view from within an action

To change the text within a view from the java class do this:

 

// declairing the text view to change

        TextView textElement = (TextView) findViewById(R.id.textView);
        textElement.setText(easyPuzzle);

//leave this line to assign a specific text

 

Alternatively use this to change it to a string from the resources folder
    //textElement.setText(R.string.my_string_name);

//leave this line to assign a string resource