I have looked in the Javadoc but couldn\'t find information related to this.
I want the application to stop executing a method if code in that method tells it to do
There are two way to stop current method/process :
Option : you can also kill the current thread to stop it.
For example :
public void onClick(){
if(condition == true){
return;
throw new YourException();
}
string.setText("This string should not change if condition = true");
}