当我运行Price方法时,我得到了IllegealStateException,但是当我只用显示方法运行它时,我没有得到任何错误
import csv
from datetime import date
while True:
amt=int(input("\nENTER THE AMOUNT "))
if amt>monthlyincome:
print("YOU HAVE SPENT MORE THAN YOUR MONTHLY INCOME!PLEASE TRY AGAIN")
else:
break
while True:
dat=input("ENTER DATE (DD/MM/YYYY):")
d=date.today()
format="%d/%m/%y"
time1=d.strftime(format)
if dat>time1:
print("PLEASE ENTER A VALID DATE")
else:
break
data=[amt,dat]
exp.append(data)
for i in exp:
d.writerow(str(i))
答案 0 :(得分:0)
尝试一下
private void Price(int number) {
TextView priceEditText = (TextView) findViewById(R.id.price_text_view);
priceEditText.setText(number.toSting());
}
答案 1 :(得分:0)
按如下所示重构代码。
private void Price(int number) {
TextView priceEditText = (TextView) findViewById(R.id.price_text_view);
priceEditText.setText(String.valueOf(number));
}