Multiple Activities in Android with 3 Activites -


i creating multiple activities in android, logcat error output.

log.txt

05-03 03:17:23.295: e/phonepolicy(1854): not preload class phone policy: com.android.internal.policy.impl.phonewindow$contextmenucallback 05-03 03:17:37.044: w/dalvikvm(1854): threadid=1: thread exiting uncaught exception (group=0x409db1f8) 05-03 03:17:37.044: e/androidruntime(1854): fatal exception: main 05-03 03:17:37.044: e/androidruntime(1854): java.lang.runtimeexception: unable start activity componentinfo{com.jumoun.itemp/com.jumoun.itemp.converter}: java.lang.classcastexception: android.widget.imagebutton cannot cast android.widget.button 05-03 03:17:37.044: e/androidruntime(1854):     @ android.app.activitythread.performlaunchactivity(activitythread.java:1956) 05-03 03:17:37.044: e/androidruntime(1854):     @ android.app.activitythread.handlelaunchactivity(activitythread.java:1981) 05-03 03:17:37.044: e/androidruntime(1854):     @ android.app.activitythread.access$600(activitythread.java:123) 05-03 03:17:37.044: e/androidruntime(1854):     @ android.app.activitythread$h.handlemessage(activitythread.java:1147) 05-03 03:17:37.044: e/androidruntime(1854):     @ android.os.handler.dispatchmessage(handler.java:99) 05-03 03:17:37.044: e/androidruntime(1854):     @ android.os.looper.loop(looper.java:137) 05-03 03:17:37.044: e/androidruntime(1854):     @ android.app.activitythread.main(activitythread.java:4427) 05-03 03:17:37.044: e/androidruntime(1854):     @ java.lang.reflect.method.invokenative(native method) 05-03 03:17:37.044: e/androidruntime(1854):     @ java.lang.reflect.method.invoke(method.java:511) 05-03 03:17:37.044: e/androidruntime(1854):     @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:795) 05-03 03:17:37.044: e/androidruntime(1854):     @ com.android.internal.os.zygoteinit.main(zygoteinit.java:562) 05-03 03:17:37.044: e/androidruntime(1854):     @ dalvik.system.nativestart.main(native method) 05-03 03:17:37.044: e/androidruntime(1854): caused by: java.lang.classcastexception: android.widget.imagebutton cannot cast android.widget.button 05-03 03:17:37.044: e/androidruntime(1854):     @ com.jumoun.itemp.converter.oncreate(converter.java:41) 05-03 03:17:37.044: e/androidruntime(1854):     @ android.app.activity.performcreate(activity.java:4465) 05-03 03:17:37.044: e/androidruntime(1854):     @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1049) 05-03 03:17:37.044: e/androidruntime(1854):     @ android.app.activitythread.performlaunchactivity(activitythread.java:1920) 05-03 03:17:37.044: e/androidruntime(1854):     ... 11 more 05-03 03:17:38.704: i/process(1854): sending signal. pid: 1854 sig: 9 

this java file converter.java http://pastebin.com/vnnpy7d5

thanks guys :)

if counted right this

ibhome3 = (button) findviewbyid(r.id.ibhome3); 

is causing problem. have imagebutton in xml button in java declaration. change

imagebutton ibhome3; 

about logcat

also, little advice on logcat. if find first line says caused by after fatal exception can track down problem easier. here

 caused by: java.lang.classcastexception: android.widget.imagebutton cannot cast android.widget.button 

this gives exception

java.lang.classcastexception 

then find first line after references package. here

at com.jumoun.itemp.converter.oncreate(converter.java:41) 

this tells problem starts in converter.java @ line 41


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -