android - Activity not foundException, but i can start it from other Activity -
i call settings activity 2 different activities in same way. however, when call second activity, recieve activitynotfoundexception.
in both activitiece called from
@override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.main, menu); return true; } @override public boolean onoptionsitemselected(menuitem item) { // handle item selection switch (item.getitemid()) { case r.id.action_settings: intent = new intent(this, settings.class); startactivity(i); return true; default: return super.onoptionsitemselected(item); } }
the error
06-27 14:42:33.131: e/androidruntime(11763): android.content.activitynotfoundexception: unable find explicit activity class {com.palsoftware.ebmapps/android.provider.settings}; have declared activity in androidmanifest.xml? 06-27 14:42:33.131: e/androidruntime(11763): @ android.app.instrumentation.checkstartactivityresult(instrumentation.java:1767) 06-27 14:42:33.131: e/androidruntime(11763): @ android.app.instrumentation.execstartactivity(instrumentation.java:1563) 06-27 14:42:33.131: e/androidruntime(11763): @ android.app.activity.startactivityforresult(activity.java:3505) 06-27 14:42:33.131: e/androidruntime(11763): @ android.app.activity.startactivityforresult(activity.java:3466) 06-27 14:42:33.131: e/androidruntime(11763): @ android.app.activity.startactivity(activity.java:3708) 06-27 14:42:33.131: e/androidruntime(11763): @ android.app.activity.startactivity(activity.java:3676) 06-27 14:42:33.131: e/androidruntime(11763): @ com.palsoftware.ebmapps.startmonitoractivity.onoptionsitemselected(startmonitoractivity.java:97) 06-27 14:42:33.131: e/androidruntime(11763): @ android.app.activity.onmenuitemselected(activity.java:2681) 06-27 14:42:33.131: e/androidruntime(11763): @ com.android.internal.policy.impl.phonewindow.onmenuitemselected(phonewindow.java:1101) 06-27 14:42:33.131: e/androidruntime(11763): @ com.android.internal.view.menu.menubuilder.dispatchmenuitemselected(menubuilder.java:735) 06-27 14:42:33.131: e/androidruntime(11763): @ com.android.internal.view.menu.menuitemimpl.invoke(menuitemimpl.java:152) 06-27 14:42:33.131: e/androidruntime(11763): @ com.android.internal.view.menu.menubuilder.performitemaction(menubuilder.java:874) 06-27 14:42:33.131: e/androidruntime(11763): @ com.android.internal.view.menu.iconmenuview.invokeitem(iconmenuview.java:494) 06-27 14:42:33.131: e/androidruntime(11763): @ com.android.internal.view.menu.iconmenuitemview.performclick(iconmenuitemview.java:126) 06-27 14:42:33.131: e/androidruntime(11763): @ android.view.view$performclick.run(view.java:18673) 06-27 14:42:33.131: e/androidruntime(11763): @ android.os.handler.handlecallback(handler.java:733) 06-27 14:42:33.131: e/androidruntime(11763): @ android.os.handler.dispatchmessage(handler.java:95) 06-27 14:42:33.131: e/androidruntime(11763): @ android.os.looper.loop(looper.java:157) 06-27 14:42:33.131: e/androidruntime(11763): @ android.app.activitythread.main(activitythread.java:5872) 06-27 14:42:33.131: e/androidruntime(11763): @ java.lang.reflect.method.invokenative(native method) 06-27 14:42:33.131: e/androidruntime(11763): @ java.lang.reflect.method.invoke(method.java:515) 06-27 14:42:33.131: e/androidruntime(11763): @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:1069) 06-27 14:42:33.131: e/androidruntime(11763): @ com.android.internal.os.zygoteinit.main(zygoteinit.java:885) 06-27 14:42:33.131: e/androidruntime(11763): @ dalvik.system.nativestart.main(native method)
activity defined in manifest:
<activity android:name="com.palsoftware.ebmapps.settings" android:screenorientation="portrait" android:theme="@android:style/theme.light.notitlebar.fullscreen" />
i think imported import android.provider.settings; instead of com.palsoftware.ebmapps.settings..
so import right class , check @ once, hope solved issue.
Comments
Post a Comment