"语法错误,插入"的原因是什么?最后"完成TryStatement"

Hip*_*ray 7 java try-catch

我正在使用eclipse创建一个Android应用程序,该应用程序获取手机上所有当前显示的应用程序的列表,但我收到的错误是我以前从未见过的.我的代码看起来正确,但在其中一个"}"括号中我得到错误"语法错误,插入"最后"完成TryStatement",有没有人知道如何解决这个错误?

谢谢.

Mat*_*lis 12

您需要有一个"catch"子句或"finally"来伴随您的尝试:

try {
    // ... something dangerous ...
} catch(IOException e) {
    // ... handle errors ...
} finally {
    // ... cleanup that will execute whether or not an error occurred ...
}
Run Code Online (Sandbox Code Playgroud)