Demand:
Want to update the UI interface after recursion ends. When is the end of recursion? Someone on the internet to judge a fixed parameter, and then end, simply inexplicable, this fixed parameter is random random, unscientific.
Ideas:
The value of size is collected according to the judgement I=0. By i=0, the length of the loop is collected, because each loop has a i=0, and there is only one, which collects the total length of the cycle according to Num.
Code:
for (int i = 0; I < ((List) data). Size (); i++) {
num++;
if (i = = 0) {
log.e (Constants.log_tag, "size:" + addnum (((List) data). Size ());
}
LOG.E (Constants.log_tag, "+ +" + num + "; Size ():" + ((List) data). Size ()); · •
}
LOG.E (Constants.log_tag, "; Num:" + num);
if (num = = size) {
///recursive end will execute
the
private int addnum (int num) {
log.e (Constants.log_tag, "addnum:" + si Ze);
size = size + num;
return size;
}