when 1 of 2 buttons invoke follow listener pressed
onclicklistener msportivelistener = new onclicklistener() { public void onclick(view v) { string title = getresources().getstring( r.string.function_sport_i); string category="sport"; startfunctionselector(title, category); } }; onclicklistener mclassiclistener = new onclicklistener() { public void onclick(view v) { string title = getresources().getstring( r.string.function_classic_i); string category="classic"; startfunctionselector(title, category); } };
the application crash details error happens on line
startactivity(selector);
of method
public void startfunctionselector(string title, string functioncategory) { intent selector = new intent(home.this, functionselector.class); selector.putextra("title", title); selector.putextra("functioncategory", functioncategory); try { startactivity(selector); } catch (runtimeexception e) { e.printstacktrace(); } }
the error isn't related functionselector.class
since whatever content put in behavior same (i have tried hello world)
unfortunately strange reason eclipse doesn't give me details error generic sourcenotfound with
// compiled handler.java (version 1.5 : 49.0, super bit) public class android.os.handler { // method descriptor #11 ()v // stack: 3, locals: 1 public handler(); 0 aload_0 [this] 1 invokespecial java.lang.object() [1] 4 new java.lang.runtimeexception [2] 7 dup 8 ldc <string "stub!"> [3] 10 invokespecial java.lang.runtimeexception(java.lang.string) [4] 13 athrow line numbers: [pc: 0, line: 8] local variable table: [pc: 0, pc: 14] local: index: 0 type: android.os.handler
but nothing specific issue.
more details
the oncreate of functionselector, have said crash if leave helloworld in activity
public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); strictmode.threadpolicy policy = new strictmode.threadpolicy.builder() .permitall().build(); strictmode.setthreadpolicy(policy); setcontentview(r.layout.selector_gui); selectortitle = getintent().getstringextra("title"); functioncategory = getintent().getstringextra("functioncategory"); buttonback = (imagebutton) findviewbyid(r.id.btback); buttonback.setonclicklistener(mbacklistener); txttitle = (textview) findviewbyid(r.id.txttitle); txttitle.settext(selectortitle); list = (listview) findviewbyid(r.id.listafunzioni); }
if try use emulator , go in allmessage (unfiltered per app) can see
07-11 14:25:51.139: e/activitythread(1550): service com.android.exchange.exchangeservice has leaked serviceconnection com.android.emailcommon.service.serviceproxy$proxyconnection@b2f46948 bound here 07-11 14:25:51.139: e/activitythread(1550): android.app.serviceconnectionleaked: service com.android.exchange.exchangeservice has leaked serviceconnection com.android.emailcommon.service.serviceproxy$proxyconnection@b2f46948 bound here 07-11 14:25:51.139: e/activitythread(1550): @ android.app.loadedapk$servicedispatcher.<init>(loadedapk.java:969) 07-11 14:25:51.139: e/activitythread(1550): @ android.app.loadedapk.getservicedispatcher(loadedapk.java:863) 07-11 14:25:51.139: e/activitythread(1550): @ android.app.contextimpl.bindservice(contextimpl.java:1418) 07-11 14:25:51.139: e/activitythread(1550): @ android.app.contextimpl.bindservice(contextimpl.java:1407) 07-11 14:25:51.139: e/activitythread(1550): @ android.content.contextwrapper.bindservice(contextwrapper.java:473) 07-11 14:25:51.139: e/activitythread(1550): @ com.android.emailcommon.service.serviceproxy.settask(serviceproxy.java:157) 07-11 14:25:51.139: e/activitythread(1550): @ com.android.emailcommon.service.serviceproxy.settask(serviceproxy.java:145) 07-11 14:25:51.139: e/activitythread(1550): @ com.android.emailcommon.service.accountserviceproxy.getdeviceid(accountserviceproxy.java:116) 07-11 14:25:51.139: e/activitythread(1550): @ com.android.exchange.exchangeservice.getdeviceid(exchangeservice.java:1249) 07-11 14:25:51.139: e/activitythread(1550): @ com.android.exchange.exchangeservice$7.run(exchangeservice.java:1856) 07-11 14:25:51.139: e/activitythread(1550): @ com.android.emailcommon.utility.utility$2.doinbackground(utility.java:551) 07-11 14:25:51.139: e/activitythread(1550): @ com.android.emailcommon.utility.utility$2.doinbackground(utility.java:549) 07-11 14:25:51.139: e/activitythread(1550): @ android.os.asynctask$2.call(asynctask.java:287) 07-11 14:25:51.139: e/activitythread(1550): @ java.util.concurrent.futuretask.run(futuretask.java:234) 07-11 14:25:51.139: e/activitythread(1550): @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1080) 07-11 14:25:51.139: e/activitythread(1550): @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:573) 07-11 14:25:51.139: e/activitythread(1550): @ java.lang.thread.run(thread.java:856) 07-11 14:25:51.139: e/strictmode(1550): null 07-11 14:25:51.139: e/strictmode(1550): android.app.serviceconnectionleaked: service com.android.exchange.exchangeservice has leaked serviceconnection com.android.emailcommon.service.serviceproxy$proxyconnection@b2f46948 bound here 07-11 14:25:51.139: e/strictmode(1550): @ android.app.loadedapk$servicedispatcher.<init>(loadedapk.java:969) 07-11 14:25:51.139: e/strictmode(1550): @ android.app.loadedapk.getservicedispatcher(loadedapk.java:863) 07-11 14:25:51.139: e/strictmode(1550): @ android.app.contextimpl.bindservice(contextimpl.java:1418) 07-11 14:25:51.139: e/strictmode(1550): @ android.app.contextimpl.bindservice(contextimpl.java:1407) 07-11 14:25:51.139: e/strictmode(1550): @ android.content.contextwrapper.bindservice(contextwrapper.java:473) 07-11 14:25:51.139: e/strictmode(1550): @ com.android.emailcommon.service.serviceproxy.settask(serviceproxy.java:157) 07-11 14:25:51.139: e/strictmode(1550): @ com.android.emailcommon.service.serviceproxy.settask(serviceproxy.java:145) 07-11 14:25:51.139: e/strictmode(1550): @ com.android.emailcommon.service.accountserviceproxy.getdeviceid(accountserviceproxy.java:116) 07-11 14:25:51.139: e/strictmode(1550): @ com.android.exchange.exchangeservice.getdeviceid(exchangeservice.java:1249) 07-11 14:25:51.139: e/strictmode(1550): @ com.android.exchange.exchangeservice$7.run(exchangeservice.java:1856) 07-11 14:25:51.139: e/strictmode(1550): @ com.android.emailcommon.utility.utility$2.doinbackground(utility.java:551) 07-11 14:25:51.139: e/strictmode(1550): @ com.android.emailcommon.utility.utility$2.doinbackground(utility.java:549) 07-11 14:25:51.139: e/strictmode(1550): @ android.os.asynctask$2.call(asynctask.java:287) 07-11 14:25:51.139: e/strictmode(1550): @ java.util.concurrent.futuretask.run(futuretask.java:234) 07-11 14:25:51.139: e/strictmode(1550): @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1080) 07-11 14:25:51.139: e/strictmode(1550): @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:573) 07-11 14:25:51.139: e/strictmode(1550): @ java.lang.thread.run(thread.java:856) 07-11 14:25:51.139: w/activitymanager(1201): unbind failed: not find connection android.os.binderproxy@b3149200 07-11 14:25:51.139: e/activitythread(1550): service com.android.exchange.exchangeservice has leaked serviceconnection com.android.emailcommon.service.serviceproxy$proxyconnection@b2f7f7c0 bound here 07-11 14:25:51.139: e/activitythread(1550): android.app.serviceconnectionleaked: service com.android.exchange.exchangeservice has leaked serviceconnection com.android.emailcommon.service.serviceproxy$proxyconnection@b2f7f7c0 bound here 07-11 14:25:51.139: e/activitythread(1550): @ android.app.loadedapk$servicedispatcher.<init>(loadedapk.java:969) 07-11 14:25:51.139: e/activitythread(1550): @ android.app.loadedapk.getservicedispatcher(loadedapk.java:863) 07-11 14:25:51.139: e/activitythread(1550): @ android.app.contextimpl.bindservice(contextimpl.java:1418) 07-11 14:25:51.139: e/activitythread(1550): @ android.app.contextimpl.bindservice(contextimpl.java:1407) 07-11 14:25:51.139: e/activitythread(1550): @ android.content.contextwrapper.bindservice(contextwrapper.java:473) 07-11 14:25:51.139: e/activitythread(1550): @ com.android.emailcommon.service.serviceproxy.settask(serviceproxy.java:157) 07-11 14:25:51.139: e/activitythread(1550): @ com.android.emailcommon.service.serviceproxy.settask(serviceproxy.java:145) 07-11 14:25:51.139: e/activitythread(1550): @ com.android.emailcommon.service.serviceproxy.test(serviceproxy.java:191) 07-11 14:25:51.139: e/activitythread(1550): @ com.android.exchange.exchangeservice$7.run(exchangeservice.java:1850) 07-11 14:25:51.139: e/activitythread(1550): @ com.android.emailcommon.utility.utility$2.doinbackground(utility.java:551) 07-11 14:25:51.139: e/activitythread(1550): @ com.android.emailcommon.utility.utility$2.doinbackground(utility.java:549) 07-11 14:25:51.139: e/activitythread(1550): @ android.os.asynctask$2.call(asynctask.java:287) 07-11 14:25:51.139: e/activitythread(1550): @ java.util.concurrent.futuretask.run(futuretask.java:234) 07-11 14:25:51.139: e/activitythread(1550): @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1080) 07-11 14:25:51.139: e/activitythread(1550): @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:573) 07-11 14:25:51.139: e/activitythread(1550): @ java.lang.thread.run(thread.java:856) 07-11 14:25:51.139: e/strictmode(1550): null 07-11 14:25:51.139: e/strictmode(1550): android.app.serviceconnectionleaked: service com.android.exchange.exchangeservice has leaked serviceconnection com.android.emailcommon.service.serviceproxy$proxyconnection@b2f7f7c0 bound here 07-11 14:25:51.139: e/strictmode(1550): @ android.app.loadedapk$servicedispatcher.<init>(loadedapk.java:969) 07-11 14:25:51.139: e/strictmode(1550): @ android.app.loadedapk.getservicedispatcher(loadedapk.java:863) 07-11 14:25:51.139: e/strictmode(1550): @ android.app.contextimpl.bindservice(contextimpl.java:1418) 07-11 14:25:51.139: e/strictmode(1550): @ android.app.contextimpl.bindservice(contextimpl.java:1407) 07-11 14:25:51.139: e/strictmode(1550): @ android.content.contextwrapper.bindservice(contextwrapper.java:473) 07-11 14:25:51.139: e/strictmode(1550): @ com.android.emailcommon.service.serviceproxy.settask(serviceproxy.java:157) 07-11 14:25:51.139: e/strictmode(1550): @ com.android.emailcommon.service.serviceproxy.settask(serviceproxy.java:145) 07-11 14:25:51.139: e/strictmode(1550): @ com.android.emailcommon.service.serviceproxy.test(serviceproxy.java:191) 07-11 14:25:51.139: e/strictmode(1550): @ com.android.exchange.exchangeservice$7.run(exchangeservice.java:1850) 07-11 14:25:51.139: e/strictmode(1550): @ com.android.emailcommon.utility.utility$2.doinbackground(utility.java:551) 07-11 14:25:51.139: e/strictmode(1550): @ com.android.emailcommon.utility.utility$2.doinbackground(utility.java:549) 07-11 14:25:51.139: e/strictmode(1550): @ android.os.asynctask$2.call(asynctask.java:287) 07-11 14:25:51.139: e/strictmode(1550): @ java.util.concurrent.futuretask.run(futuretask.java:234) 07-11 14:25:51.139: e/strictmode(1550): @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1080) 07-11 14:25:51.139: e/strictmode(1550): @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:573) 07-11 14:25:51.139: e/strictmode(1550): @ java.lang.thread.run(thread.java:856)
try these steps
1) try include full path of activity when initialize intent example
intent selector = new intent(home.this, com.yourpackagename.youractivity.class);
same thing in activity declaration in manifest
2) verify resources correctly linked , there no errors in manifest , in xml files of gui
3) assuming have declared activity in manifest, , resources in on create correctly initialized. goes wrong in eclipse caches delete .metadata folder in workspace , try re-import project.
Comments
Post a Comment