我注意到当在catch块内使用时,没有显示toast。 有没有人知道如何在捕捉异常时显示敬酒?一个例子:Toast在catch块中使用时不显示
try {
// try to open a file
} catch (FileNotFoundException e) {
Toast.makeText(this, R.string.txt_file_not_found, Toast.LENGTH_LONG);
return; // cancel processing
}
是否出现返回声明? – JimR 2010-10-31 19:29:57
不,我试过了,它没有改变任何东西。什么都没有发生...... – cody 2010-10-31 19:37:45