I am creating a randomly generated string in android studio and im having trouble converting it to the textview with the click of a button. I need to call this string from my OnClick function for the button, and I need to know the correct parameters to use in order to do so.
Here is the string code:
String randomString( int len ){
StringBuilder sb = new StringBuilder( len );
for( int i = 0; i < len; i++ )
sb.append( AB.charAt( rnd.nextInt(AB.length()) ) );
txt.setText(sb); //attempt to push to text, but need to somehow call this in a function from a button
return sb.toString();
}
Thanks to anyone who can help! Just trying to call that String that is made (randomstring) from a function by the press of my button.