문제

    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?
    }
도움이 되었습니까?

해결책

Are you serious? That kind of things cannot be just "catched"... they have to be fixed. Just fix your XML file and that's it... it does not make sense to catch such as Exception; what would you do after catching it?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top