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?
    }
有帮助吗?

解决方案

你是认真的?那种事情不能只是“逮住的” ......他们必须是固定的。刚修好你的XML文件,这就是它......它没有意义赶上比如异常;你会赶上它后做什么?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top