[英]unreachable statement on Android Studio?
我在 Andoid 工作室得到了这个无法访问的声明,我尝试修复数据结构,但没有发生任何事情,有人可以帮助我吗? 问题出在
this.income += ((Income) this.li.get(i)).getJumlah();
这是我的代码
public static int uang;
private Button btnDeveloper;
private Button btnExit;
private Button btnIncome;
private Button btnOutcome;
private Button btnPassword;
private Button btnReport;
private Dialog dialog;
private IncomeDataSource iDS;
private int income;
private Intent intent;
private ArrayList<Income> li = new ArrayList();
private ArrayList<Outcome> lo = new ArrayList();
private MoneyDataSource mDS;
private Money money;
private OutcomeDataSource oDS;
private int outcome;
private String tuang = "";
private TextView txtUang;
public void bindingList()
{
this.li = getAllIncome();
this.income = 0;
int i = 0;
if (i >= this.li.size())
{
this.lo = getAllOutcome();
this.outcome = 0;
}
for (int j = 0; ; j++)
{
if (j >= this.lo.size())
{
return;
this.income += ((Income) this.li.get(i)).getJumlah();
i++;
break;
}
this.outcome += ((Outcome)this.lo.get(j)).getJumlah();
}
}
只需从 if 循环中删除 return :)
public void bindingList()
{
this.li = getAllIncome();
this.income = 0;
int i = 0;
if (i >= this.li.size())
{
this.lo = getAllOutcome();
this.outcome = 0;
}
for (int j = 0; ; j++)
{
if (j >= this.lo.size())
{
this.income += ((Income) this.li.get(i)).getJumlah();
i++;
break;
}
this.outcome += ((Outcome)this.lo.get(j)).getJumlah();
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.