【note】the application has stopped unexpectable2

今天在插入一个新的Activity的之后,切换到那个Activity的时候又出现“the application has stopped unexpectable”。

当时以为是在AndroidManifest注册这个新Activiy的时候它没存好。看了下,语句有写在那里。

后来发现是几行局域的问题。有个ImageView,后来我需要它有点击的功能,就在新的class中直接把它转换成了ImageButton

(ImageButton button = (ImageButton)this.findViewById(R.id.imageView);)

问题就出在这里,不能这样转换,编译器不会报错,运行时就会出错。

posted on 2013-09-12 23:38  rub_y  阅读(147)  评论(0)    收藏  举报

导航