public class MyActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//R.layout.main has an illegal element (e.g. no layout_height attribute)
//But no exception is thrown at this line.
setContentView(R.layout.main);
} //Exception will be thrown after this line. Where to catch it?
}发布于 2010-09-29 21:48:01
你肯定?这类事情不能只是“抓到”……它们必须被修复。只需修复您的XML文件,仅此而已。捕捉这样的异常是没有意义的;捕捉到它之后你会怎么做?
https://stackoverflow.com/questions/3822149
复制相似问题