android weird error while launching application - android

I am getting this error while launching the app, and I have checked the manifest file and the activities are there. Rathbones is the main activity.
10-19 13:27:14.796: ERROR/AndroidRuntime(441): FATAL EXCEPTION: main
10-19 13:27:14.796: ERROR/AndroidRuntime(441): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.rathbones.src/com.rathbones.src.RathbonesActivity}: java.lang.InstantiationException: com.rathbones.src.RathbonesActivity
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1739)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1831)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.ActivityThread.access$500(ActivityThread.java:122)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1024)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.os.Handler.dispatchMessage(Handler.java:99)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.os.Looper.loop(Looper.java:132)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.ActivityThread.main(ActivityThread.java:4123)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at java.lang.reflect.Method.invokeNative(Native Method)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at java.lang.reflect.Method.invoke(Method.java:491)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at dalvik.system.NativeStart.main(Native Method)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): Caused by: java.lang.InstantiationException: com.rathbones.src.RathbonesActivity
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at java.lang.Class.newInstanceImpl(Native Method)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at java.lang.Class.newInstance(Class.java:1301)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.Instrumentation.newActivity(Instrumentation.java:1022)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1730)
10-19 13:27:14.796: ERROR/AndroidRuntime(441): ... 11 more
10-19 13:27:14.806: WARN/ActivityManager(78): Force finishing activity com.rathbones.src/.RathbonesActivity

check if the .RathbonesActivity activity is in your main package say com.activity.RathbonesActivity
or to be sure write full path in activity declaration in manifest as com.packagename.RathbonesActivity
check this StackOverflow Question to understand what the "." dot means and how to use it.

Related

Fragment SuperAwesomeCardFragment{430a5280} is not currently in the FragmentManager

10-19 20:15:28.570: E/AndroidRuntime(612): java.lang.IllegalStateException: Fragment SuperAwesomeCardFragment{430a5280} is not currently in the FragmentManager
10-19 20:15:28.570: E/AndroidRuntime(612): at android.support.v4.app.FragmentManagerImpl.putFragment(FragmentManager.java:516)
10-19 20:15:28.570: E/AndroidRuntime(612): at android.support.v4.app.FragmentStatePagerAdapter.saveState(FragmentStatePagerAdapter.java:185)
10-19 20:15:28.570: E/AndroidRuntime(612): at android.support.v4.view.ViewPager.onSaveInstanceState(ViewPager.java:1072)
10-19 20:15:28.570: E/AndroidRuntime(612): at android.view.View.dispatchSaveInstanceState(View.java:10010)
10-19 20:15:28.570: E/AndroidRuntime(612): at android.view.ViewGroup.dispatchSaveInstanceState(ViewGroup.java:2304)
10-19 20:15:28.570: E/AndroidRuntime(612): at android.view.ViewGroup.dispatchSaveInstanceState(ViewGroup.java:2310)
10-19 20:15:28.570: E/AndroidRuntime(612): at android.view.ViewGroup.dispatchSaveInstanceState(ViewGroup.java:2310)
10-19 20:15:28.570: E/AndroidRuntime(612): at android.view.ViewGroup.dispatchSaveInstanceState(ViewGroup.java:2310)
10-19 20:15:28.570: E/AndroidRuntime(612): at android.view.ViewGroup.dispatchSaveInstanceState(ViewGroup.java:2310)
10-19 20:15:28.570: E/AndroidRuntime(612): at android.view.ViewGroup.dispatchSaveInstanceState(ViewGroup.java:2310)
10-19 20:15:28.570: E/AndroidRuntime(612): at android.view.ViewGroup.dispatchSaveInstanceStat
I am getting this error. and then I am using tab activity whenever I change from frament or viewpager activity to move other activity to show this error from logcat. How to avoid this error ? Thanks in advance.

Getting error while using tabhost in 2.3.3

Hello i am using the tabhost in my application it works fine in 4.0 and up but when i try to run it in 2.3.3 it returns me a null pointer exception and force closes the application
here is the code i am getting error in :
TextView t = new TextView(this) ;
t= (TextView) getTabWidget().getChildAt(i).findViewById(android.R.id.title);
t.setTextColor(Color. parseColor("#ffffff"));
if (i == 0) tabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor("#00aedb"));
else tabHost.getTabWidget().getChildAt(i).setBackgroundColor(Color.parseColor("#0d82df"));
this is my logcat output :
05-16 12:29:27.009: E/AndroidRuntime(534): FATAL EXCEPTION: main
05-16 12:29:27.009: E/AndroidRuntime(534): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.moneyminder/com.example.moneyminder.MainActivity}: java.lang.NullPointerException
05-16 12:29:27.009: E/AndroidRuntime(534): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
05-16 12:29:27.009: E/AndroidRuntime(534): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
05-16 12:29:27.009: E/AndroidRuntime(534): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
05-16 12:29:27.009: E/AndroidRuntime(534): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
05-16 12:29:27.009: E/AndroidRuntime(534): at android.os.Handler.dispatchMessage(Handler.java:99)
05-16 12:29:27.009: E/AndroidRuntime(534): at android.os.Looper.loop(Looper.java:123)
05-16 12:29:27.009: E/AndroidRuntime(534): at android.app.ActivityThread.main(ActivityThread.java:3683)
05-16 12:29:27.009: E/AndroidRuntime(534): at java.lang.reflect.Method.invokeNative(Native Method)
05-16 12:29:27.009: E/AndroidRuntime(534): at java.lang.reflect.Method.invoke(Method.java:507)
05-16 12:29:27.009: E/AndroidRuntime(534): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
05-16 12:29:27.009: E/AndroidRuntime(534): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
05-16 12:29:27.009: E/AndroidRuntime(534): at dalvik.system.NativeStart.main(Native Method)
05-16 12:29:27.009: E/AndroidRuntime(534): Caused by: java.lang.NullPointerException
05-16 12:29:27.009: E/AndroidRuntime(534): at com.example.moneyminder.MainActivity.onCreate(MainActivity.java:78)
05-16 12:29:27.009: E/AndroidRuntime(534): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-16 12:29:27.009: E/AndroidRuntime(534): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
05-16 12:29:27.009: E/AndroidRuntime(534): ... 11 more

NullPointerexception in itemizedOverlay [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
in android application I am using the Google API for maps. I got the following exception. I want to know what exactly this exception means ?
10-19 23:45:06.619: E/AndroidRuntime(837): FATAL EXCEPTION: main
10-19 23:45:06.619: E/AndroidRuntime(837): java.lang.NullPointerException
10-19 23:45:06.619: E/AndroidRuntime(837): at com.google.android.maps.ItemizedOverlay.getItemsAtLocation(ItemizedOverlay.java:617)
10-19 23:45:06.619: E/AndroidRuntime(837): at com.google.android.maps.ItemizedOverlay.getItemAtLocation(ItemizedOverlay.java:586)
10-19 23:45:06.619: E/AndroidRuntime(837): at com.google.android.maps.ItemizedOverlay.handleMotionEvent(ItemizedOverlay.java:498)
10-19 23:45:06.619: E/AndroidRuntime(837): at com.google.android.maps.ItemizedOverlay.onTouchEvent(ItemizedOverlay.java:572)
10-19 23:45:06.619: E/AndroidRuntime(837): at com.google.android.maps.OverlayBundle.onTouchEvent(OverlayBundle.java:63)
10-19 23:45:06.619: E/AndroidRuntime(837): at com.google.android.maps.MapView.onTouchEvent(MapView.java:679)
10-19 23:45:06.619: E/AndroidRuntime(837): at android.view.View.dispatchTouchEvent(View.java:3885)
10-19 23:45:06.619: E/AndroidRuntime(837): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903)
10-19 23:45:06.619: E/AndroidRuntime(837): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
10-19 23:45:06.619: E/AndroidRuntime(837): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
10-19 23:45:06.619: E/AndroidRuntime(837): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
10-19 23:45:06.619: E/AndroidRuntime(837): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869)
10-19 23:45:06.619: E/AndroidRuntime(837): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1691)
10-19 23:45:06.619: E/AndroidRuntime(837): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1125)
10-19 23:45:06.619: E/AndroidRuntime(837): at android.app.Activity.dispatchTouchEvent(Activity.java:2096)
10-19 23:45:06.619: E/AndroidRuntime(837): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1675)
10-19 23:45:06.619: E/AndroidRuntime(837): at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2194)
10-19 23:45:06.619: E/AndroidRuntime(837): at android.view.ViewRoot.handleMessage(ViewRoot.java:1878)
10-19 23:45:06.619: E/AndroidRuntime(837): at android.os.Handler.dispatchMessage(Handler.java:99)
10-19 23:45:06.619: E/AndroidRuntime(837): at android.os.Looper.loop(Looper.java:130)
10-19 23:45:06.619: E/AndroidRuntime(837): at android.app.ActivityThread.main(ActivityThread.java:3683)
10-19 23:45:06.619: E/AndroidRuntime(837): at java.lang.reflect.Method.invokeNative(Native Method)
10-19 23:45:06.619: E/AndroidRuntime(837): at java.lang.reflect.Method.invoke(Method.java:507)
10-19 23:45:06.619: E/AndroidRuntime(837): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
10-19 23:45:06.619: E/AndroidRuntime(837): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
10-19 23:45:06.619: E/AndroidRuntime(837): at dalvik.system.NativeStart.main(Native Method)
The sound like you forgot to add populate() in the constructor.
It should be like:
LocationItemizedOverlay(Drawable defaultMarker, Context context) {
super(boundCenterBottom(defaultMarker));
this.context = context;
populate(); // Add this
}
.....
Its happens on moving map

application has stopped unexpectedly

When I run my android application it gives an error "The application has stopped working,please try again". Please help me to solve this problem. i have created a method which gets called when the button gets clicked. When I include the code for calling another class in this method it shows the above error & when I remove that code it neither shows the error nor goes ahead when listview etc. gets clicked. Can you please check my code and help me please.
CODE:
public void myClickHandler(View view)
{
//Toast.makeText(this, "yesss",Toast.LENGTH_LONG).show();
setContentView(R.layout.screen1);
ListAdapter adapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, city);
ListView FirstProjectActivity = (ListView) findViewById(R.id.mylist1);
FirstProjectActivity.setAdapter(adapter);
Intent myIntent = new Intent(FirstProjectActivity.this,
City.class);
FirstProjectActivity.this.startActivity(myIntent);
//startActivity(new Intent(FirstProjectActivity.this, City.class));
}
LOGCAT is as follows:
03-02 18:56:28.136: D/AndroidRuntime(316): Shutting down VM
03-02 18:56:28.136: W/dalvikvm(316): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
03-02 18:56:28.226: E/AndroidRuntime(316): FATAL EXCEPTION: main
03-02 18:56:28.226: E/AndroidRuntime(316): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.FirstProject/com.example.FirstProject.FirstProjectActivity}: java.lang.NullPointerException
03-02 18:56:28.226: E/AndroidRuntime(316): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
03-02 18:56:28.226: E/AndroidRuntime(316): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
03-02 18:56:28.226: E/AndroidRuntime(316): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
03-02 18:56:28.226: E/AndroidRuntime(316): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
03-02 18:56:28.226: E/AndroidRuntime(316): at android.os.Handler.dispatchMessage(Handler.java:99)
03-02 18:56:28.226: E/AndroidRuntime(316): at android.os.Looper.loop(Looper.java:123)
03-02 18:56:28.226: E/AndroidRuntime(316): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-02 18:56:28.226: E/AndroidRuntime(316): at java.lang.reflect.Method.invokeNative(Native Method)
03-02 18:56:28.226: E/AndroidRuntime(316): at java.lang.reflect.Method.invoke(Method.java:521)
03-02 18:56:28.226: E/AndroidRuntime(316): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-02 18:56:28.226: E/AndroidRuntime(316): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-02 18:56:28.226: E/AndroidRuntime(316): at dalvik.system.NativeStart.main(Native Method)
03-02 18:56:28.226: E/AndroidRuntime(316): Caused by: java.lang.NullPointerException
03-02 18:56:28.226: E/AndroidRuntime(316): at com.example.FirstProject.FirstProjectActivity.onCreate(FirstProjectActivity.java:37)
03-02 18:56:28.226: E/AndroidRuntime(316): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-02 18:56:28.226: E/AndroidRuntime(316): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
03-02 18:56:28.226: E/AndroidRuntime(316): ... 11 more
03-02 18:56:35.396: I/Process(316): Sending signal. PID: 316 SIG: 9
03-02 19:02:51.836: D/AndroidRuntime(351): Shutting down VM
03-02 19:02:51.836: W/dalvikvm(351): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
03-02 19:02:51.866: E/AndroidRuntime(351): FATAL EXCEPTION: main
03-02 19:02:51.866: E/AndroidRuntime(351): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.FirstProject/com.example.FirstProject.FirstProjectActivity}: java.lang.NullPointerException
03-02 19:02:51.866: E/AndroidRuntime(351): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
03-02 19:02:51.866: E/AndroidRuntime(351): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
03-02 19:02:51.866: E/AndroidRuntime(351): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
03-02 19:02:51.866: E/AndroidRuntime(351): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
03-02 19:02:51.866: E/AndroidRuntime(351): at android.os.Handler.dispatchMessage(Handler.java:99)
03-02 19:02:51.866: E/AndroidRuntime(351): at android.os.Looper.loop(Looper.java:123)
03-02 19:02:51.866: E/AndroidRuntime(351): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-02 19:02:51.866: E/AndroidRuntime(351): at java.lang.reflect.Method.invokeNative(Native Method)
03-02 19:02:51.866: E/AndroidRuntime(351): at java.lang.reflect.Method.invoke(Method.java:521)
03-02 19:02:51.866: E/AndroidRuntime(351): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-02 19:02:51.866: E/AndroidRuntime(351): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-02 19:02:51.866: E/AndroidRuntime(351): at dalvik.system.NativeStart.main(Native Method)
03-02 19:02:51.866: E/AndroidRuntime(351): Caused by: java.lang.NullPointerException
03-02 19:02:51.866: E/AndroidRuntime(351): at com.example.FirstProject.FirstProjectActivity.onCreate(FirstProjectActivity.java:37)
03-02 19:02:51.866: E/AndroidRuntime(351): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-02 19:02:51.866: E/AndroidRuntime(351): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
03-02 19:02:51.866: E/AndroidRuntime(351): ... 11 more
03-02 19:03:03.647: I/Process(351): Sending signal. PID: 351 SIG: 9
03-02 20:11:17.722: W/KeyCharacterMap(379): No keyboard for id 0
03-02 20:11:17.926: W/KeyCharacterMap(379): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
03-02 20:11:28.441: D/dalvikvm(379): GC_EXPLICIT freed 3121 objects / 172672 bytes in 1696ms
03-03 01:03:02.696: W/KeyCharacterMap(406): No keyboard for id 0
03-03 01:03:02.696: W/KeyCharacterMap(406): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
03-03 01:03:08.566: D/dalvikvm(406): GC_EXPLICIT freed 2874 objects / 162408 bytes in 192ms
03-03 01:33:06.566: D/AndroidRuntime(432): Shutting down VM
03-03 01:33:06.566: W/dalvikvm(432): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
03-03 01:33:06.726: E/AndroidRuntime(432): FATAL EXCEPTION: main
03-03 01:33:06.726: E/AndroidRuntime(432): java.lang.IllegalStateException: Could not execute method of the activity
03-03 01:33:06.726: E/AndroidRuntime(432): at android.view.View$1.onClick(View.java:2072)
03-03 01:33:06.726: E/AndroidRuntime(432): at android.view.View.performClick(View.java:2408)
03-03 01:33:06.726: E/AndroidRuntime(432): at android.view.View$PerformClick.run(View.java:8816)
03-03 01:33:06.726: E/AndroidRuntime(432): at android.os.Handler.handleCallback(Handler.java:587)
03-03 01:33:06.726: E/AndroidRuntime(432): at android.os.Handler.dispatchMessage(Handler.java:92)
03-03 01:33:06.726: E/AndroidRuntime(432): at android.os.Looper.loop(Looper.java:123)
03-03 01:33:06.726: E/AndroidRuntime(432): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-03 01:33:06.726: E/AndroidRuntime(432): at java.lang.reflect.Method.invokeNative(Native Method)
03-03 01:33:06.726: E/AndroidRuntime(432): at java.lang.reflect.Method.invoke(Method.java:521)
03-03 01:33:06.726: E/AndroidRuntime(432): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-03 01:33:06.726: E/AndroidRuntime(432): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-03 01:33:06.726: E/AndroidRuntime(432): at dalvik.system.NativeStart.main(Native Method)
03-03 01:33:06.726: E/AndroidRuntime(432): Caused by: java.lang.reflect.InvocationTargetException
03-03 01:33:06.726: E/AndroidRuntime(432): at com.example.FirstProject.FirstProjectActivity.myClickHandler(FirstProjectActivity.java:69)
03-03 01:33:06.726: E/AndroidRuntime(432): at java.lang.reflect.Method.invokeNative(Native Method)
03-03 01:33:06.726: E/AndroidRuntime(432): at java.lang.reflect.Method.invoke(Method.java:521)
03-03 01:33:06.726: E/AndroidRuntime(432): at android.view.View$1.onClick(View.java:2067)
03-03 01:33:06.726: E/AndroidRuntime(432): ... 11 more
03-03 01:33:06.726: E/AndroidRuntime(432): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.FirstProject/com.example.FirstProject.City}; have you declared this activity in your AndroidManifest.xml?
03-03 01:33:06.726: E/AndroidRuntime(432): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)
03-03 01:33:06.726: E/AndroidRuntime(432): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
03-03 01:33:06.726: E/AndroidRuntime(432): at android.app.Activity.startActivityForResult(Activity.java:2817)
03-03 01:33:06.726: E/AndroidRuntime(432): at android.app.Activity.startActivity(Activity.java:2923)
03-03 01:33:06.726: E/AndroidRuntime(432): ... 15 more
03-03 01:33:08.956: I/Process(432): Sending signal. PID: 432 SIG: 9
03-03 01:34:05.387: D/AndroidRuntime(460): Shutting down VM
03-03 01:34:05.387: W/dalvikvm(460): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
03-03 01:34:05.417: E/AndroidRuntime(460): FATAL EXCEPTION: main
03-03 01:34:05.417: E/AndroidRuntime(460): java.lang.IllegalStateException: Could not execute method of the activity
03-03 01:34:05.417: E/AndroidRuntime(460): at android.view.View$1.onClick(View.java:2072)
03-03 01:34:05.417: E/AndroidRuntime(460): at android.view.View.performClick(View.java:2408)
03-03 01:34:05.417: E/AndroidRuntime(460): at android.view.View$PerformClick.run(View.java:8816)
03-03 01:34:05.417: E/AndroidRuntime(460): at android.os.Handler.handleCallback(Handler.java:587)
03-03 01:34:05.417: E/AndroidRuntime(460): at android.os.Handler.dispatchMessage(Handler.java:92)
03-03 01:34:05.417: E/AndroidRuntime(460): at android.os.Looper.loop(Looper.java:123)
03-03 01:34:05.417: E/AndroidRuntime(460): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-03 01:34:05.417: E/AndroidRuntime(460): at java.lang.reflect.Method.invokeNative(Native Method)
03-03 01:34:05.417: E/AndroidRuntime(460): at java.lang.reflect.Method.invoke(Method.java:521)
03-03 01:34:05.417: E/AndroidRuntime(460): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-03 01:34:05.417: E/AndroidRuntime(460): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-03 01:34:05.417: E/AndroidRuntime(460): at dalvik.system.NativeStart.main(Native Method)
03-03 01:34:05.417: E/AndroidRuntime(460): Caused by: java.lang.reflect.InvocationTargetException
03-03 01:34:05.417: E/AndroidRuntime(460): at com.example.FirstProject.FirstProjectActivity.myClickHandler(FirstProjectActivity.java:70)
03-03 01:34:05.417: E/AndroidRuntime(460): at java.lang.reflect.Method.invokeNative(Native Method)
03-03 01:34:05.417: E/AndroidRuntime(460): at java.lang.reflect.Method.invoke(Method.java:521)
03-03 01:34:05.417: E/AndroidRuntime(460): at android.view.View$1.onClick(View.java:2067)
03-03 01:34:05.417: E/AndroidRuntime(460): ... 11 more
03-03 01:34:05.417: E/AndroidRuntime(460): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.FirstProject/com.example.FirstProject.City}; have you declared this activity in your AndroidManifest.xml?
03-03 01:34:05.417: E/AndroidRuntime(460): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)
03-03 01:34:05.417: E/AndroidRuntime(460): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
03-03 01:34:05.417: E/AndroidRuntime(460): at android.app.Activity.startActivityForResult(Activity.java:2817)
03-03 01:34:05.417: E/AndroidRuntime(460): at android.app.Activity.startActivity(Activity.java:2923)
03-03 01:34:05.417: E/AndroidRuntime(460): ... 15 more
03-03 01:34:11.016: I/Process(460): Sending signal. PID: 460 SIG: 9
03-03 01:35:33.547: D/AndroidRuntime(490): Shutting down VM
03-03 01:35:33.557: W/dalvikvm(490): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
03-03 01:35:33.577: E/AndroidRuntime(490): FATAL EXCEPTION: main
03-03 01:35:33.577: E/AndroidRuntime(490): java.lang.IllegalStateException: Could not execute method of the activity
03-03 01:35:33.577: E/AndroidRuntime(490): at android.view.View$1.onClick(View.java:2072)
03-03 01:35:33.577: E/AndroidRuntime(490): at android.view.View.performClick(View.java:2408)
03-03 01:35:33.577: E/AndroidRuntime(490): at android.view.View$PerformClick.run(View.java:8816)
03-03 01:35:33.577: E/AndroidRuntime(490): at android.os.Handler.handleCallback(Handler.java:587)
03-03 01:35:33.577: E/AndroidRuntime(490): at android.os.Handler.dispatchMessage(Handler.java:92)
03-03 01:35:33.577: E/AndroidRuntime(490): at android.os.Looper.loop(Looper.java:123)
03-03 01:35:33.577: E/AndroidRuntime(490): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-03 01:35:33.577: E/AndroidRuntime(490): at java.lang.reflect.Method.invokeNative(Native Method)
03-03 01:35:33.577: E/AndroidRuntime(490): at java.lang.reflect.Method.invoke(Method.java:521)
03-03 01:35:33.577: E/AndroidRuntime(490): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-03 01:35:33.577: E/AndroidRuntime(490): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-03 01:35:33.577: E/AndroidRuntime(490): at dalvik.system.NativeStart.main(Native Method)
03-03 01:35:33.577: E/AndroidRuntime(490): Caused by: java.lang.reflect.InvocationTargetException
03-03 01:35:33.577: E/AndroidRuntime(490): at com.example.FirstProject.FirstProjectActivity.myClickHandler(FirstProjectActivity.java:70)
03-03 01:35:33.577: E/AndroidRuntime(490): at java.lang.reflect.Method.invokeNative(Native Method)
03-03 01:35:33.577: E/AndroidRuntime(490): at java.lang.reflect.Method.invoke(Method.java:521)
03-03 01:35:33.577: E/AndroidRuntime(490): at android.view.View$1.onClick(View.java:2067)
03-03 01:35:33.577: E/AndroidRuntime(490): ... 11 more
03-03 01:35:33.577: E/AndroidRuntime(490): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.FirstProject/com.example.FirstProject.City}; have you declared this activity in your AndroidManifest.xml?
03-03 01:35:33.577: E/AndroidRuntime(490): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)
03-03 01:35:33.577: E/AndroidRuntime(490): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
03-03 01:35:33.577: E/AndroidRuntime(490): at android.app.Activity.startActivityForResult(Activity.java:2817)
03-03 01:35:33.577: E/AndroidRuntime(490): at android.app.Activity.startActivity(Activity.java:2923)
03-03 01:35:33.577: E/AndroidRuntime(490): ... 15 more
03-03 01:35:39.176: I/Process(490): Sending signal. PID: 490 SIG: 9
03-03 01:36:06.947: D/AndroidRuntime(517): Shutting down VM
03-03 01:36:06.947: W/dalvikvm(517): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
03-03 01:36:06.967: E/AndroidRuntime(517): FATAL EXCEPTION: main
03-03 01:36:06.967: E/AndroidRuntime(517): java.lang.IllegalStateException: Could not execute method of the activity
03-03 01:36:06.967: E/AndroidRuntime(517): at android.view.View$1.onClick(View.java:2072)
03-03 01:36:06.967: E/AndroidRuntime(517): at android.view.View.performClick(View.java:2408)
03-03 01:36:06.967: E/AndroidRuntime(517): at android.view.View$PerformClick.run(View.java:8816)
03-03 01:36:06.967: E/AndroidRuntime(517): at android.os.Handler.handleCallback(Handler.java:587)
03-03 01:36:06.967: E/AndroidRuntime(517): at android.os.Handler.dispatchMessage(Handler.java:92)
03-03 01:36:06.967: E/AndroidRuntime(517): at android.os.Looper.loop(Looper.java:123)
03-03 01:36:06.967: E/AndroidRuntime(517): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-03 01:36:06.967: E/AndroidRuntime(517): at java.lang.reflect.Method.invokeNative(Native Method)
03-03 01:36:06.967: E/AndroidRuntime(517): at java.lang.reflect.Method.invoke(Method.java:521)
03-03 01:36:06.967: E/AndroidRuntime(517): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-03 01:36:06.967: E/AndroidRuntime(517): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-03 01:36:06.967: E/AndroidRuntime(517): at dalvik.system.NativeStart.main(Native Method)
03-03 01:36:06.967: E/AndroidRuntime(517): Caused by: java.lang.reflect.InvocationTargetException
03-03 01:36:06.967: E/AndroidRuntime(517): at com.example.FirstProject.FirstProjectActivity.myClickHandler(FirstProjectActivity.java:70)
03-03 01:36:06.967: E/AndroidRuntime(517): at java.lang.reflect.Method.invokeNative(Native Method)
03-03 01:36:06.967: E/AndroidRuntime(517): at java.lang.reflect.Method.invoke(Method.java:521)
03-03 01:36:06.967: E/AndroidRuntime(517): at android.view.View$1.onClick(View.java:2067)
03-03 01:36:06.967: E/AndroidRuntime(517): ... 11 more
03-03 01:36:06.967: E/AndroidRuntime(517): Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.FirstProject/com.example.FirstProject.City}; have you declared this activity in your AndroidManifest.xml?
03-03 01:36:06.967: E/AndroidRuntime(517): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404)
03-03 01:36:06.967: E/AndroidRuntime(517): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378)
03-03 01:36:06.967: E/AndroidRuntime(517): at android.app.Activity.startActivityForResult(Activity.java:2817)
03-03 01:36:06.967: E/AndroidRuntime(517): at android.app.Activity.startActivity(Activity.java:2923)
03-03 01:36:06.967: E/AndroidRuntime(517): ... 15 more
03-03 01:36:13.306: I/Process(517): Sending signal. PID: 517 SIG: 9
When you want to detect if you click on an item you need to implement the onItemClickedListener i will give you an example below like i would do it:
listView.setOnItemClickListener(new MyOnitemClickListener());
//no i make my own class that impelemnts the onitemclicklistener
public class MyOnitemClickListener implements OnItemClickListener {
private int position = 0;
public void onItemClick(AdapterView<?> parent, View view, int pos,
long lat) {
// clicked on parent.getid()
if (parent.getId() == R.id.listView) {
//do something
}
}
}
after a crash, try looking for the first couple of red lines the LOGCAT spews to you as they usually explain what happened.
the following line :
java.lang.NullPointerException
(in line 5) showed up on you log, it usually means your trying to use an uninitialized object.
refer to:
What is a NullPointerException, and how do I fix it?

Switching between activities in a tab gives error the application has stopped unexpectedly. Please try again

I am working on android application and I am struck at the below error. Can anybody of you help me out with this error:
When I switch between activities in a tab I was able to do it for 2 times on 3rd time I get the error saying Sorry...application has stopped unexpectedly. Please try again.
I tried to take the info from LogCat file below is the information:
10-19 03:21:53.794: INFO/dalvikvm(460): threadid=1: stack overflow on call to Lsun/misc/Unsafe;.compareAndSwapInt:ZLJII
10-19 03:21:53.804: INFO/dalvikvm(460): method requires 24+20+0=44 bytes, fp is 0x4186931c (28 left)
10-19 03:21:53.804: INFO/dalvikvm(460): expanding stack end (0x41869300 to 0x41869000)
10-19 03:21:53.815: INFO/dalvikvm(460): Shrank stack (to 0x41869300, curFrame is 0x4186bc60)
10-19 03:21:53.844: DEBUG/AndroidRuntime(460): Shutting down VM
10-19 03:21:53.854: WARN/dalvikvm(460): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): FATAL EXCEPTION: main
10-19 03:21:53.984: ERROR/AndroidRuntime(460): java.lang.StackOverflowError
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at java.util.concurrent.locks.AbstractQueuedSynchronizer.compareAndSetState(AbstractQueuedSynchronizer.java:522)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at java.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:182)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at java.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:261)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at java.util.concurrent.CopyOnWriteArrayList.remove(CopyOnWriteArrayList.java:490)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewTreeObserver.removeOnPreDrawListener(ViewTreeObserver.java:377)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.widget.TextView.onDraw(TextView.java:3875)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.View.draw(View.java:6740)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.View.draw(View.java:6743)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.View.draw(View.java:6743)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.widget.FrameLayout.draw(FrameLayout.java:352)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.View.draw(View.java:6743)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.widget.FrameLayout.draw(FrameLayout.java:352)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.View.draw(View.java:6743)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.widget.FrameLayout.draw(FrameLayout.java:352)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.View.draw(View.java:6743)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.widget.FrameLayout.draw(FrameLayout.java:352)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.View.draw(View.java:6743)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.widget.FrameLayout.draw(FrameLayout.java:352)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.View.draw(View.java:6743)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.widget.FrameLayout.draw(FrameLayout.java:352)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.View.draw(View.java:6743)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.widget.FrameLayout.draw(FrameLayout.java:352)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.View.draw(View.java:6743)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.widget.FrameLayout.draw(FrameLayout.java:352)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.View.draw(View.java:6743)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.widget.FrameLayout.draw(FrameLayout.java:352)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
10-19 03:21:53.984: ERROR/AndroidRuntime(460): at android.view
10-19 03:21:54.265: DEBUG/dalvikvm(460): GC_FOR_MALLOC freed 3579 objects / 314384 bytes in 218ms
10-19 03:21:54.335: WARN/ActivityManager(59): Force finishing activity com.muo.Livegroups/.Main
10-19 03:21:54.984: WARN/ActivityManager(59): Activity pause timeout for HistoryRecord{450548b0 com.muo.Livegroups/.Main}
10-19 03:21:57.244: INFO/Process(460): Sending signal. PID: 460 SIG: 9
10-19 03:21:57.334: INFO/ActivityManager(59): Process com.muo.Livegroups (pid 460) has died.
10-19 03:21:57.364: INFO/WindowManager(59): WIN DEATH: Window{45054b98 com.muo.Livegroups/com.muo.Livegroups.Main paused=false}
10-19 03:21:57.414: WARN/InputManagerService(59): Got RemoteException sending setActive(false) notification to pid 460 uid 10036
10-19 03:22:04.183: DEBUG/SntpClient(59): request time failed: java.net.SocketException: Address family not supported by protocol
10-19 03:22:06.441: WARN/ActivityManager(59): Activity destroy timeout for HistoryRecord{450548b0 com.muo.Livegroups/.Main}
I tried to use logcat and got the above information.
Can anybody help me to find the solution I get the error only when I go to different activity on 3rd time. First 2 times it works fine.
Your UI is too complicated, and you are running out of stack space when trying to render it. Use Hierarchy View and try to reduce the number of layers between the root View of your activity and the farthest leaves.

Categories

Resources