Android HelloWorld App Crashes On Implementation of Second Activity

后端 未结 3 1434
野趣味
野趣味 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:42

    According to this line:

    No view found for id 0x7f05003c (com.example.myfirstapp:id/container) for fragment PlaceholderFragment{4137cd30 #0 id=0x7f05003c} 
    

    You never declare your R.id.container item. And it's right - you never do declare it in your XML layout. I'm not exactly sure what you're trying to do with that, but you should add that to your XML layout, or just remove it (it doesn't really look like you're using it).

    It doesn't really look like the fragment you declare is needed. As it's just a simple activity, a fragment shouldn't really be needed.

提交回复
热议问题