Android HelloWorld App Crashes On Implementation of Second Activity

后端 未结 3 1437
野趣味
野趣味 2021-01-21 07:26

I am attempting to complete the Android HelloWorld App using Eclipse and the ADT. However, the app always crashes when I implement the second activity and press the \"Send\" but

3条回答
  •  面向向阳花
    2021-01-21 07:45

    I had similar problem. When I rechecked the tutorial from which you are also learning i.e. developer.android, I found that in the onCreate method of DisplayMessageActivity class the following codes of lines are causing disruptions,(I have commented it)

    if (savedInstanceState == null) {
           getSupportFragmentManager().beginTransaction()
                   .add(R.id.container, PlaceholderFragment.newInstance(message)).commit();
       }
    

    Please delete these lines. If you carefully observe the tutorial there they present the code of onCreate at last to cross check, there these line are missing. :)

提交回复
热议问题