For Strings..
How can i Detect if the string "name" has the text "Hello" a toast will come up saying yes but if it doesn't a toast will come up saying no? my code:
String ft;
if(ft.contains("Hello")){
Toast.makeText(main.this ,"Yes", Toast.LENGTH_SHORT).show();
}
else{
Toast.makeText(main.this ,"No", Toast.LENGTH_SHORT).show();
}
I get a error at ft on if(ft.contains("Hello")) {
"The local variable ft may not have been initialized"
Stringempty. tryString ft="";