Skip to content Skip to sidebar Skip to footer

Android How To Terminate Functionand Return To Asyntask After Getting Spesific Value

how to terminate function at spesific point i use break but its not work help me please i want when current date match with database not procesing further and function close break

Solution 1:

Replace break with return. break just breaks the loop, return "stops" the method.

Solution 2:

Change you function's return type from void to int or else and return any thing when your desired action completed. for eg.

inttest_func(){ 

 //your code hereif(actionCompleted){
    return1;
// function will be closed 
 }
else//your codereturn0;
}  

Post a Comment for "Android How To Terminate Functionand Return To Asyntask After Getting Spesific Value"