Search Results

Search found 239 results on 10 pages for 'dalvik'.

Page 7/10 | < Previous Page | 3 4 5 6 7 8 9 10  | Next Page >

  • Android: ActivityThread.performLaunchActivity error

    - by fordays
    Hi, I'm getting an ActivityThread.performLaunchActivity(ActivityThread$ActivityRecord,Intent) error each time I boot up my program in the debugger. The program won't even start up! Any help would be greatly appreciated! I'm very new to this environment. Let me know if you need anymore information/code to help me out. Here is my logcat: 06-09 11:16:26.848: ERROR/vold(27): Error opening switch name path '/sys/class/switch/test2' (No such file or directory) 06-09 11:16:26.848: ERROR/vold(27): Error bootstrapping switch '/sys/class/switch/test2' (No such file or directory) 06-09 11:16:26.848: ERROR/vold(27): Error opening switch name path '/sys/class/switch/test' (No such file or directory) 06-09 11:16:26.848: ERROR/vold(27): Error bootstrapping switch '/sys/class/switch/test' (No such file or directory) 06-09 11:16:37.887: ERROR/MemoryHeapBase(53): error opening /dev/pmem: No such file or directory 06-09 11:16:37.887: ERROR/SurfaceFlinger(53): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake 06-09 11:16:37.927: ERROR/libEGL(53): couldn't load <libhgl.so> library (Cannot load library: load_library[984]: Library 'libhgl.so' not found) 06-09 11:16:38.407: ERROR/libEGL(64): couldn't load <libhgl.so> library (Cannot load library: load_library[984]: Library 'libhgl.so' not found) 06-09 11:16:41.358: ERROR/BatteryService(53): Could not open '/sys/class/power_supply/usb/online' 06-09 11:16:41.367: ERROR/BatteryService(53): Could not open '/sys/class/power_supply/battery/batt_vol' 06-09 11:16:41.367: ERROR/BatteryService(53): Could not open '/sys/class/power_supply/battery/batt_temp' 06-09 11:16:41.667: ERROR/EventHub(53): could not get driver version for /dev/input/mouse0, Not a typewriter 06-09 11:16:41.667: ERROR/EventHub(53): could not get driver version for /dev/input/mice, Not a typewriter 06-09 11:16:41.797: ERROR/System(53): Failure starting core service 06-09 11:16:41.797: ERROR/System(53): java.lang.SecurityException 06-09 11:16:41.797: ERROR/System(53): at android.os.BinderProxy.transact(Native Method) 06-09 11:16:41.797: ERROR/System(53): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146) 06-09 11:16:41.797: ERROR/System(53): at android.os.ServiceManager.addService(ServiceManager.java:72) 06-09 11:16:41.797: ERROR/System(53): at com.android.server.ServerThread.run(SystemServer.java:162) 06-09 11:16:41.797: ERROR/AndroidRuntime(53): Crash logging skipped, no checkin service 06-09 11:16:42.777: ERROR/LockPatternKeyguardView(53): Failed to bind to GLS while checking for account 06-09 11:16:46.557: ERROR/ActivityThread(111): Failed to find provider info for com.google.settings 06-09 11:16:46.577: ERROR/ActivityThread(111): Failed to find provider info for com.google.settings 06-09 11:16:49.087: ERROR/ApplicationContext(53): Couldn't create directory for SharedPreferences file shared_prefs/wallpaper-hints.xml 06-09 11:16:51.146: ERROR/ActivityThread(108): Failed to find provider info for android.server.checkin 06-09 11:16:54.266: ERROR/ActivityThread(108): Failed to find provider info for android.server.checkin 06-09 11:16:54.416: ERROR/ActivityThread(108): Failed to find provider info for android.server.checkin 06-09 11:16:56.336: ERROR/MediaPlayerService(31): Couldn't open fd for content://settings/system/notification_sound 06-09 11:16:56.356: ERROR/MediaPlayer(53): Unable to to create media player 06-09 11:16:56.637: ERROR/AndroidRuntime(201): Uncaught handler: thread main exiting due to uncaught exception 06-09 11:16:56.757: ERROR/AndroidRuntime(201): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.svgeeks.kidneytest/com.svgeeks.kidneytest.KidneyTest}: java.lang.ClassCastException: android.widget.EditText 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at android.app.ActivityThread.access$2100(ActivityThread.java:116) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at android.os.Handler.dispatchMessage(Handler.java:99) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at android.os.Looper.loop(Looper.java:123) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at android.app.ActivityThread.main(ActivityThread.java:4203) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at java.lang.reflect.Method.invokeNative(Native Method) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at java.lang.reflect.Method.invoke(Method.java:521) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at dalvik.system.NativeStart.main(Native Method) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): Caused by: java.lang.ClassCastException: android.widget.EditText 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at com.svgeeks.kidneytest.KidneyTest.onCreate(KidneyTest.java:57) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364) 06-09 11:16:56.757: ERROR/AndroidRuntime(201): ... 11 more 06-09 11:16:56.876: ERROR/dalvikvm(201): Unable to open stack trace file '/data/anr/traces.txt': Permission denied

    Read the article

  • Custom listview entry works in JB not in Gingerbread

    - by Andy
    I have a ListFragment with a custom ArrayAdapter where I am overiding getView() to provide a custom View for the list item. private class DirListAdaptor extends ArrayAdapter<DirItem> { @Override public View getView(int position, View convertView, ViewGroup parent) { View aView = convertView; if (aView == null) { LayoutInflater vi = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); // TODO: can we not access textViewResourceId? aView = vi.inflate(R.layout.dir_list_entry, parent, false); } etc... Here is the dir_list_entry.xml: <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="?android:attr/listPreferredItemHeight" android:paddingLeft="?android:attr/listPreferredItemPaddingLeft" android:paddingRight="?android:attr/listPreferredItemPaddingRight"> <ImageView android:id="@+id/dir_list_icon" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_alignParentTop="true" android:layout_alignParentBottom="true" android:layout_marginRight="6dp" android:src="@drawable/ic_launcher" /> <TextView android:id="@+id/dir_list_details" android:textAppearance="?android:attr/textAppearanceListItem" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_toRightOf="@id/dir_list_icon" android:layout_alignParentBottom="true" android:layout_alignParentRight="true" android:singleLine="true" android:ellipsize="marquee" android:textSize="12sp" android:text="Details" /> <TextView android:id="@+id/dir_list_filename" android:textAppearance="?android:attr/textAppearanceListItem" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_toRightOf="@id/dir_list_icon" android:layout_alignParentRight="true" android:layout_alignParentTop="true" android:layout_above="@id/dir_list_details" android:layout_alignWithParentIfMissing="true" android:gravity="center_vertical" android:textSize="14sp" android:text="Filename"/> </RelativeLayout> The bizarre thing is this works fine on Android 4.1 emulator, but I get the following error on Android 2.3: 10-01 15:07:59.594: ERROR/AndroidRuntime(1003): FATAL EXCEPTION: main android.view.InflateException: Binary XML file line #1: Error inflating class android.widget.RelativeLayout at android.view.LayoutInflater.createView(LayoutInflater.java:518) at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568) at android.view.LayoutInflater.inflate(LayoutInflater.java:386) at android.view.LayoutInflater.inflate(LayoutInflater.java:320) at com.eveps.evepsdroid.ui.PhotoBrowserListFragment$DirListAdaptor.getView(PhotoBrowserListFragment.java:104) at android.widget.AbsListView.obtainView(AbsListView.java:1430) at android.widget.ListView.makeAndAddView(ListView.java:1745) at android.widget.ListView.fillDown(ListView.java:670) at android.widget.ListView.fillFromTop(ListView.java:727) at android.widget.ListView.layoutChildren(ListView.java:1598) at android.widget.AbsListView.onLayout(AbsListView.java:1260) at android.view.View.layout(View.java:7175) at android.widget.FrameLayout.onLayout(FrameLayout.java:338) at android.view.View.layout(View.java:7175) at android.widget.FrameLayout.onLayout(FrameLayout.java:338) at android.view.View.layout(View.java:7175) at android.widget.FrameLayout.onLayout(FrameLayout.java:338) at android.view.View.layout(View.java:7175) at android.widget.FrameLayout.onLayout(FrameLayout.java:338) at android.view.View.layout(View.java:7175) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254) at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1243) at android.widget.LinearLayout.onLayout(LinearLayout.java:1049) at android.view.View.layout(View.java:7175) at android.widget.FrameLayout.onLayout(FrameLayout.java:338) at android.view.View.layout(View.java:7175) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1254) at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1130) at android.widget.LinearLayout.onLayout(LinearLayout.java:1047) at android.view.View.layout(View.java:7175) at android.widget.FrameLayout.onLayout(FrameLayout.java:338) at android.view.View.layout(View.java:7175) at android.view.ViewRoot.performTraversals(ViewRoot.java:1140) at android.view.ViewRoot.handleMessage(ViewRoot.java:1859) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:3683) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:507) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:415) at android.view.LayoutInflater.createView(LayoutInflater.java:505) ... 42 more Caused by: java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x2 at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:463) at android.view.View.<init>(View.java:1957) at android.view.View.<init>(View.java:1899) at android.view.ViewGroup.<init>(ViewGroup.java:286) at android.widget.RelativeLayout.<init>(RelativeLayout.java:173) ... 45 more I'm using the Android Support library for fragment support obviously. Seems to be a problem inflating the custom list view entry, something to do with a dimension - but why does it work on JellyBean? Has something changed in this area?

    Read the article

  • Android: Custom ListAdapter extending BaseAdapter crashes on application launch.

    - by Danny
    Data being pulled from a local DB, then mapped using a cursor. Custom Adapter displays data similar to a ListView. As items are added/deleted from the DB, the adapter is supposed to refresh. The solution attempted below crashes the application at launch. Any suggestions? Thanks in advance, -D @Override public View getView(int position, View convertView, ViewGroup parent) { View v = convertView; ViewGroup p = parent; if (v == null) { LayoutInflater vi = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); v = vi.inflate(R.layout.items_row, p); } int size = mAdapter.getCount(); Log.d(TAG, "position " + position + " Size " + size); if(size != 0){ if(position < size) return mAdapter.getView(position, v, p); Log.d(TAG, "-position " + position + " Size " + size); } return null; } Errors: 03-23 00:14:10.392: ERROR/AndroidRuntime(718): java.lang.UnsupportedOperationException: addView(View, LayoutParams) is not supported in AdapterView 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.widget.AdapterView.addView(AdapterView.java:461) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.view.LayoutInflater.inflate(LayoutInflater.java:415) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at com.xyz.abc.CustomSeparatedListAdapter.getView(CustomSeparatedListAdapter.java:90) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.widget.AbsListView.obtainView(AbsListView.java:1273) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.widget.ListView.makeAndAddView(ListView.java:1658) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.widget.ListView.fillDown(ListView.java:637) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.widget.ListView.fillFromTop(ListView.java:694) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.widget.ListView.layoutChildren(ListView.java:1516) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.widget.AbsListView.onLayout(AbsListView.java:1112) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.view.View.layout(View.java:6569) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.widget.FrameLayout.onLayout(FrameLayout.java:333) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.view.View.layout(View.java:6569) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.widget.FrameLayout.onLayout(FrameLayout.java:333) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.view.View.layout(View.java:6569) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.widget.FrameLayout.onLayout(FrameLayout.java:333) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.view.View.layout(View.java:6569) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1119) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.widget.LinearLayout.layoutVertical(LinearLayout.java:998) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.widget.LinearLayout.onLayout(LinearLayout.java:918) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.view.View.layout(View.java:6569) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.widget.FrameLayout.onLayout(FrameLayout.java:333) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.view.View.layout(View.java:6569) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.widget.FrameLayout.onLayout(FrameLayout.java:333) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.view.View.layout(View.java:6569) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.widget.FrameLayout.onLayout(FrameLayout.java:333) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.view.View.layout(View.java:6569) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.view.ViewRoot.performTraversals(ViewRoot.java:979) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.view.ViewRoot.handleMessage(ViewRoot.java:1613) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.os.Handler.dispatchMessage(Handler.java:99) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.os.Looper.loop(Looper.java:123) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at android.app.ActivityThread.main(ActivityThread.java:4203) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at java.lang.reflect.Method.invokeNative(Native Method) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at java.lang.reflect.Method.invoke(Method.java:521) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 03-23 00:14:10.392: ERROR/AndroidRuntime(718): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • How to open new view (call an activity) from options menu defined in XML? (android)

    - by Portablejim
    I cant seem to open a new view from an options menu item. The program keeps crashing as it applies the intent and listener to the item. I am just beginning, so please be nice. The current view is mnfsms, and the view I am trying to open is mnfsms_settings. I am developing for 1.5. Could someone please help me get the menu working. The menu (called options_menu.xml): <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/settings_button" android:title="Settings" android:icon="@android:drawable/ic_menu_preferences" /> <item android:id="@+id/about_button" android:title="About" android:icon="@android:drawable/ic_menu_myplaces" /> </menu> The main view (called mnfsms.java): package com.example.mnfsms; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; public class mnfsms extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); /* OnClickListener myocl = new View.OnClickListener() { public void onClick(View v){ Intent myi = new Intent(mnfsms.this, mnfsms_settings.class); startActivity(myi); } };*/ } public boolean onCreateOptionsMenu(Menu menu) { MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.options_menu, menu); MenuItem mi_settings = (MenuItem)findViewById(R.id.settings_button); mi_settings.setIntent(new Intent(this, mnfsms_settings.class)); return true; } } The manifest: <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.mnfsms" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".mnfsms" android:label="@string/main_window_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".mnfsms_settings" android:label="string/main_window_name"> </activity> </application> <uses-sdk android:minSdkVersion="3" /> </manifest> The stacktrace: 01-06 15:07:58.045: ERROR/AndroidRuntime(2123): Uncaught handler: thread main exiting due to uncaught exception 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): java.lang.NullPointerException 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at com.example.mnfsms.mnfsms.onCreateOptionsMenu(mnfsms.java:30) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at android.app.Activity.onCreatePanelMenu(Activity.java:2038) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:421) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at com.android.internal.policy.impl.PhoneWindow.onKeyDownPanel(PhoneWindow.java:664) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at com.android.internal.policy.impl.PhoneWindow.onKeyDown(PhoneWindow.java:1278) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:1735) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at android.view.ViewRoot.deliverKeyEventToViewHierarchy(ViewRoot.java:2188) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at android.view.ViewRoot.handleFinishedEvent(ViewRoot.java:2158) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at android.view.ViewRoot.handleMessage(ViewRoot.java:1490) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at android.os.Handler.dispatchMessage(Handler.java:99) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at android.os.Looper.loop(Looper.java:123) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at android.app.ActivityThread.main(ActivityThread.java:3948) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at java.lang.reflect.Method.invokeNative(Native Method) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at java.lang.reflect.Method.invoke(Method.java:521) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540) 01-06 15:07:58.055: ERROR/AndroidRuntime(2123): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • AlerDialog is not created - java.lang.IllegalArgumentException: Activity#onCreateDialog did not crea

    - by Jayomat
    Hi, I want to create a normal AlertDialog. I used the example provided by the android dev docs. I just changed the DIALOG_PAUSED_ID to DIALOG_DELETEDB. If I execute my code and press the button which in return should create the dialog, I get the following error log: 04-29 01:01:20.973: WARN/dalvikvm(1168): threadid=3: thread exiting with uncaught exception (group=0x4001b188) 04-29 01:01:20.973: ERROR/AndroidRuntime(1168): Uncaught handler: thread main exiting due to uncaught exception 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): java.lang.IllegalArgumentException: Activity#onCreateDialog did not create a dialog for id 4 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at android.app.Activity.createDialog(Activity.java:871) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at android.app.Activity.showDialog(Activity.java:2483) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at mjb.project.AVV.Favs.onMenuItemSelected(Favs.java:111) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at com.android.internal.policy.impl.PhoneWindow.onMenuItemSelected(PhoneWindow.java:730) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at com.android.internal.view.menu.MenuItemImpl.invoke(MenuItemImpl.java:139) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at com.android.internal.view.menu.MenuBuilder.performItemAction(MenuBuilder.java:855) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at com.android.internal.view.menu.IconMenuView.invokeItem(IconMenuView.java:525) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at com.android.internal.view.menu.IconMenuItemView.performClick(IconMenuItemView.java:122) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at android.view.View.onTouchEvent(View.java:4179) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at android.widget.TextView.onTouchEvent(TextView.java:6540) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at android.view.View.dispatchTouchEvent(View.java:3709) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:884) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1643) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at android.view.ViewRoot.handleMessage(ViewRoot.java:1691) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at android.os.Handler.dispatchMessage(Handler.java:99) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at android.os.Looper.loop(Looper.java:123) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at android.app.ActivityThread.main(ActivityThread.java:4363) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at java.lang.reflect.Method.invokeNative(Native Method) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at java.lang.reflect.Method.invoke(Method.java:521) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 04-29 01:01:20.993: ERROR/AndroidRuntime(1168): at dalvik.system.NativeStart.main(Native Method) so here are the "relevant" code parts: define the ID: private static final int DELETE_DB_ID = 3; private Dialog dialog; static final int DIALOG_DELETEDB = 4; onCreateDialog(...): protected Dialog onCreateDialog(int id) { switch(id) { case DIALOG_DELETEDB: // do the work to define the pause Dialog AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage("Are you sure you want to exit?") .setCancelable(false) .setPositiveButton("Yes", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Favs.this.finish(); } }) .setNegativeButton("No", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }); AlertDialog alert = builder.create(); alert.show(); break; default: dialog = null; } return dialog; } Here I try to "create" the dialog: @Override public boolean onMenuItemSelected(int featureId, MenuItem item) { switch(item.getItemId()) { case ADD_ID: createNote(); return true; case DELETE_DB_ID: showDialog(DIALOG_DELETEDB); return true; } return super.onMenuItemSelected(featureId, item); } As I already said, I just copied the code and changed the name. Unfortunately, I don't understand the error log message.. :/ Somehow I think I don't return the created dialog, but I cannot see "where" my reference is or where/what I have to return... thanks in advance for help.

    Read the article

  • java.lang.RuntimeException: Unable to start activity ComponentInfo cannot be cast to android.widget.ZoomControls

    - by Hwl
    I'm new to android development, hope you all can help me. I got this androidVNC viewer source code from internet. When i'm running the androidVNC application in the emulator, it will exit automatically then i get following errors in LogCat. Can anyone one help me? Thanks. FATAL EXCEPTION: main java.lang.RuntimeException: Unable to start activity ComponentInfo{android.androidVNC/android.androidVNC.VncCanvasActivity}: java.lang.ClassCastException: com.antlersoft.android.zoomer.ZoomControls cannot be cast to android.widget.ZoomControls at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1955) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980) at android.app.ActivityThread.access$600(ActivityThread.java:122) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4340) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.ClassCastException: com.antlersoft.android.zoomer.ZoomControls cannot be cast to android.widget.ZoomControls at android.androidVNC.VncCanvasActivity.onCreate(VncCanvasActivity.java:585) at android.app.Activity.performCreate(Activity.java:4465) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919) ... 11 more This is the ZoomControls java file: package com.antlersoft.android.zoomer; import android.content.Context; import android.util.AttributeSet; import android.view.LayoutInflater; import android.view.MotionEvent; import android.view.View; import android.view.animation.AlphaAnimation; import android.widget.ImageButton; import android.widget.LinearLayout; import android.widget.ZoomButton; public class ZoomControls extends LinearLayout { private final ZoomButton mZoomIn; private final ZoomButton mZoomOut; private final ImageButton mZoomKeyboard; public ZoomControls(Context context) { this(context, null); } public ZoomControls(Context context, AttributeSet attrs) { super(context, attrs); setFocusable(false); LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); inflater.inflate(R.layout.zoom_controls, this, // we are the parent true); mZoomIn = (ZoomButton) findViewById(R.id.zoomIn); mZoomOut = (ZoomButton) findViewById(R.id.zoomOut); mZoomKeyboard = (ImageButton) findViewById(R.id.zoomKeys); } public void setOnZoomInClickListener(OnClickListener listener) { mZoomIn.setOnClickListener(listener); } public void setOnZoomOutClickListener(OnClickListener listener) { mZoomOut.setOnClickListener(listener); } public void setOnZoomKeyboardClickListener(OnClickListener listener) { mZoomKeyboard.setOnClickListener(listener); } /* * Sets how fast you get zoom events when the user holds down the * zoom in/out buttons. */ public void setZoomSpeed(long speed) { mZoomIn.setZoomSpeed(speed); mZoomOut.setZoomSpeed(speed); } @Override public boolean onTouchEvent(MotionEvent event) { /* Consume all touch events so they don't get dispatched to the view * beneath this view. */ return true; } public void show() { fade(View.VISIBLE, 0.0f, 1.0f); } public void hide() { fade(View.GONE, 1.0f, 0.0f); } private void fade(int visibility, float startAlpha, float endAlpha) { AlphaAnimation anim = new AlphaAnimation(startAlpha, endAlpha); anim.setDuration(500); startAnimation(anim); setVisibility(visibility); } public void setIsZoomInEnabled(boolean isEnabled) { mZoomIn.setEnabled(isEnabled); } public void setIsZoomOutEnabled(boolean isEnabled) { mZoomOut.setEnabled(isEnabled); } @Override public boolean hasFocus() { return mZoomIn.hasFocus() || mZoomOut.hasFocus(); } } This is the zoom_controls XML file: <merge xmlns:android="http://schemas.android.com/apk/res/android"> <ZoomButton android:id="@+id/zoomOut" android:background="@drawable/btn_zoom_down" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <ImageButton android:id="@+id/zoomKeys" android:background="@android:drawable/ic_dialog_dialer" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <ZoomButton android:id="@+id/zoomIn" android:background="@drawable/btn_zoom_up" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </merge>

    Read the article

  • Classcastexception occurs randomly

    - by kjhari02
    Hi, I've an application in the market and many users have reported that the app is crashing a lot randomly. I'm trying to fix this but cannot fully understand the logs. Here's a extract from the log, 04-16 13:16:32.407 E/AndroidRuntime( 9237): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.maya.mobile.chiki/com.maya.mobile.chiki.tabview.Tabs3}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.maya.mobile.chiki/com.maya.mobile.chiki.featured.FeaturedView}: java.lang.ClassCastException: android.view.AbsSavedState$1 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.os.Handler.dispatchMessage(Handler.java:99) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.os.Looper.loop(Looper.java:123) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.main(ActivityThread.java:4363) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at java.lang.reflect.Method.invokeNative(Native Method) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at java.lang.reflect.Method.invoke(Method.java:521) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at dalvik.system.NativeStart.main(Native Method) 04-16 13:16:32.407 E/AndroidRuntime( 9237): Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.maya.mobile.chiki/com.maya.mobile.chiki.featured.FeaturedView}: java.lang.ClassCastException: android.view.AbsSavedState$1 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.startActivityNow(ActivityThread.java:2335) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:648) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.widget.TabHost.setCurrentTab(TabHost.java:320) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at com.maya.mobile.chiki.tabview.CustomTabHost.setCurrentTab(CustomTabHost.java:43) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.widget.TabHost.addTab(TabHost.java:213) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at com.maya.mobile.chiki.tabview.Tabs3.doCreateTabs(Tabs3.java:180) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at com.maya.mobile.chiki.tabview.Tabs3.onCreate(Tabs3.java:149) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459) 04-16 13:16:32.407 E/AndroidRuntime( 9237): ... 11 more 04-16 13:16:32.407 E/AndroidRuntime( 9237): Caused by: java.lang.ClassCastException: android.view.AbsSavedState$1 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.widget.AbsSpinner.onRestoreInstanceState(AbsSpinner.java:440) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.View.dispatchRestoreInstanceState(View.java:5940) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.ViewGroup.dispatchThawSelfOnly(ViewGroup.java:1140) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.widget.AdapterView.dispatchRestoreInstanceState(AdapterView.java:767) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1127) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1127) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1127) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:1127) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.view.View.restoreHierarchyState(View.java:5919) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at com.android.internal.policy.impl.PhoneWindow.restoreHierarchyState(PhoneWindow.java:1454) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.Activity.onRestoreInstanceState(Activity.java:835) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.Activity.performRestoreInstanceState(Activity.java:807) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1096) 04-16 13:16:32.407 E/AndroidRuntime( 9237): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2473) 04-16 13:16:32.407 E/AndroidRuntime( 9237): ... 22 more I got this log from one of my users. Any help on this would be very very helpful. Regards, Hari

    Read the article

  • My android app crash before load main.xml

    - by Saverio Puccia
    my android app crash before load main.xml. This is the exception thrown java.lang.RuntimeException: Unable to resume activity...: java.lang.NullPointerException What happens? For completeness I enclose my manifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="saverio.puccia.nfcauth" android:versionCode="1" android:versionName="1.0" > //permission <uses-sdk android:minSdkVersion="10" /> <uses-permission android:name="android.permission.NFC"></uses-permission> <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission> //main declaration <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <activity android:name=".NFCAuthActivity" android:label="@string/app_name" > //intent filter declaration <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> <intent-filter> <action android:name="android.intent.action.NDEF_DISCOVER" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> </application> </manifest> LOGCAT 06-25 11:03:23.670: E/AndroidRuntime(4323): FATAL EXCEPTION: main 06-25 11:03:23.670: E/AndroidRuntime(4323): java.lang.RuntimeException: Unable to resume activity {saverio.puccia.nfcauth/saverio.puccia.nfcauth.NFCAuthActivity}: java.lang.NullPointerException 06-25 11:03:23.670: E/AndroidRuntime(4323): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2456) 06-25 11:03:23.670: E/AndroidRuntime(4323): at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2484) 06-25 11:03:23.670: E/AndroidRuntime(4323): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1998) 06-25 11:03:23.670: E/AndroidRuntime(4323): at android.app.ActivityThread.access$600(ActivityThread.java:127) 06-25 11:03:23.670: E/AndroidRuntime(4323): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1159) 06-25 11:03:23.670: E/AndroidRuntime(4323): at android.os.Handler.dispatchMessage(Handler.java:99) 06-25 11:03:23.670: E/AndroidRuntime(4323): at android.os.Looper.loop(Looper.java:137) 06-25 11:03:23.670: E/AndroidRuntime(4323): at android.app.ActivityThread.main(ActivityThread.java:4507) 06-25 11:03:23.670: E/AndroidRuntime(4323): at java.lang.reflect.Method.invokeNative(Native Method) 06-25 11:03:23.670: E/AndroidRuntime(4323): at java.lang.reflect.Method.invoke(Method.java:511) 06-25 11:03:23.670: E/AndroidRuntime(4323): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790) 06-25 11:03:23.670: E/AndroidRuntime(4323): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557) 06-25 11:03:23.670: E/AndroidRuntime(4323): at dalvik.system.NativeStart.main(Native Method) 06-25 11:03:23.670: E/AndroidRuntime(4323): Caused by: java.lang.NullPointerException 06-25 11:03:23.670: E/AndroidRuntime(4323): at saverio.puccia.nfcauth.NFCAuthActivity.onResume(NFCAuthActivity.java:103) 06-25 11:03:23.670: E/AndroidRuntime(4323): at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1157) 06-25 11:03:23.670: E/AndroidRuntime(4323): at android.app.Activity.performResume(Activity.java:4539) 06-25 11:03:23.670: E/AndroidRuntime(4323): at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2446) 06-25 11:03:23.670: E/AndroidRuntime(4323): ... 12 more 06-25 11:03:23.670: W/ActivityManager(1998): Force finishing activity r.intent.getComponent().flattenToShortString()

    Read the article

  • NullPointerException in ItemizedOverlay.getIndexToDraw

    - by lyricsboy
    I have a relatively simple MapActivity that I'm trying to make display a list of "camps" within a given map region. I've created a custom subclass of OverlayItem called CampOverlayItem, a custom ItemizedOverlay called CampsOverlay that returns CampOverlayItems, and of course a MapActivity subclass that populates the map. I'm pulling the overlay data from a database using an AsyncTask as created in my activity. The AsyncTask is triggered from a ViewTreeObserver.OnGlobalLayoutListener attached to the MapView. In the onPostExecute method of the AsyncTask, I create a new instance of my CampsOverlay class and pass it a list of the camps returned from the database (which are fetched in doInBackground). I then call: mapView.getOverlays().add(newOverlay); where newOverlay is the CampsOverlay I just created. All of this code runs without error, but when the Map tries to draw itself, I get a NullPointerException with the following stack trace: java.lang.NullPointerException at com.google.android.maps.ItemizedOverlay.getIndexToDraw(ItemizedOverlay.java: 211) at com.google.android.maps.ItemizedOverlay.draw(ItemizedOverlay.java:240) at com.google.android.maps.Overlay.draw(Overlay.java:179) at com.google.android.maps.OverlayBundle.draw(OverlayBundle.java: 42) at com.google.android.maps.MapView.onDraw(MapView.java:476) at android.view.View.draw(View.java:6274) at android.view.ViewGroup.drawChild(ViewGroup.java:1526) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) at android.view.ViewGroup.drawChild(ViewGroup.java:1524) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) at android.view.View.draw(View.java:6277) at android.widget.FrameLayout.draw(FrameLayout.java:352) at android.view.ViewGroup.drawChild(ViewGroup.java:1526) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) at android.view.ViewGroup.drawChild(ViewGroup.java:1524) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) at android.view.ViewGroup.drawChild(ViewGroup.java:1524) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) at android.view.ViewGroup.drawChild(ViewGroup.java:1524) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) at android.view.ViewGroup.drawChild(ViewGroup.java:1524) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) at android.view.View.draw(View.java:6277) at android.widget.FrameLayout.draw(FrameLayout.java:352) at android.view.ViewGroup.drawChild(ViewGroup.java:1526) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1256) at android.view.View.draw(View.java:6277) at android.widget.FrameLayout.draw(FrameLayout.java:352) at com.android.internal.policy.impl.PhoneWindow $DecorView.draw(PhoneWindow.java:1883) at android.view.ViewRoot.draw(ViewRoot.java:1332) at android.view.ViewRoot.performTraversals(ViewRoot.java:1097) at android.view.ViewRoot.handleMessage(ViewRoot.java:1613) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:123) at android.app.ActivityThread.main(ActivityThread.java:4203) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:521) at com.android.internal.os.ZygoteInit $MethodAndArgsCaller.run(ZygoteInit.java:791) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) at dalvik.system.NativeStart.main(Native Method) Because it seems particularly relevant, here is the code for my ItemizedOverlay subclass: public class CampsOverlay extends ItemizedOverlay<CampOverlayItem> { private ArrayList<Camp> camps = null; public CampsOverlay(Drawable defaultMarker, ArrayList<Camp> theCamps) { super(defaultMarker); this.camps = theCamps; } @Override protected CampOverlayItem createItem(int i) { Camp camp = camps.get(i); CampOverlayItem item = new CampOverlayItem(camp); return item; } @Override protected boolean onTap(int index) { // TODO Auto-generated method stub return super.onTap(index); } @Override public int size() { return camps.size(); } } Does anyone have any idea what could be happening here? I've attempted to verify that everything I have control over is non-null. I can provide more code if necessary.

    Read the article

  • BroadcastReceiver not reading stored value from SharedPreferences

    - by bobby123
    In my app I have a broadcast receiver that turns on GPS upon receiving a set string of text. In the onLocationChanged method, I want to pass the GPS data and a value from my shared preferences to a thread in a string. I have the thread writing to log and can see all the GPS values in the string but the last value from my shared preferences is just showing up as 'prefPhoneNum' which I initialised the string to at the beginning of the receiver class. I have the same code to read the prefPhoneNum from shared preferences in the main class and it works there, can anyone see what I might be doing wrong? public class SmsReceiver extends BroadcastReceiver implements LocationListener { LocationManager lm; LocationListener loc; public SharedPreferences sharedpreferences; public static final String US = "usersettings"; public String prefPhoneNum = "prefPhoneNum"; @Override public void onReceive(Context context, Intent intent) { sharedpreferences = context.getSharedPreferences(US, Context.MODE_PRIVATE); prefPhoneNum = sharedpreferences.getString("prefPhoneNum" , ""); lm = (LocationManager)context.getSystemService(Context.LOCATION_SERVICE); loc = new SmsReceiver(); //---get the SMS message passed in--- Bundle bundle = intent.getExtras(); SmsMessage[] msgs = null; String str = ""; if (bundle != null) { //---retrieve the SMS message received--- Object[] pdus = (Object[]) bundle.get("pdus"); msgs = new SmsMessage[pdus.length]; for (int i=0; i<msgs.length; i++) { msgs[i] = SmsMessage.createFromPdu((byte[])pdus[i]); str += msgs[i].getMessageBody().toString() + "\n"; } Toast.makeText(context, str, Toast.LENGTH_SHORT).show(); //Display SMS if ((msgs[0].getMessageBody().toString().equals("Enable")) || (msgs[0].getMessageBody().toString().equals("enable"))) { enableGPS(); } else { /* Do Nothing*/ } } } public void enableGPS() { //new CountDownTimer(10000, 1000) { //10 seconds new CountDownTimer(300000, 1000) { //300 secs = 5 mins public void onTick(long millisUntilFinished) { lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, loc); } public void onFinish() { lm.removeUpdates(loc); } }.start(); } @Override public void onLocationChanged(Location location) { String s = ""; s += location.getLatitude() + "\n"; s += location.getLongitude() + "\n"; s += location.getAltitude() + "\n"; s += location.getAccuracy() + "\n" + prefPhoneNum; Thread cThread = new Thread(new SocketsClient(s)); cThread.start(); } @Override public void onProviderDisabled(String provider) { } @Override public void onProviderEnabled(String provider) { } @Override public void onStatusChanged(String provider, int status, Bundle extras) { } } Here is the logcat for when the application shuts - D/LocationManager( 3912): requestLocationUpdates: provider = gps, listener = accel.working.TrackGPS@4628bce0 D/GpsLocationProvider( 96): setMinTime 0 D/GpsLocationProvider( 96): startNavigating D/GpsLocationProvider( 96): TTFF: 3227 D/AndroidRuntime( 3912): Shutting down VM W/dalvikvm( 3912): threadid=1: thread exiting with uncaught exception (group=0x400259f8) E/AndroidRuntime( 3912): FATAL EXCEPTION: main E/AndroidRuntime( 3912): java.lang.NullPointerException E/AndroidRuntime( 3912): at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:146) E/AndroidRuntime( 3912): at accel.working.TrackGPS.onLocationChanged(TrackGPS.java:63) E/AndroidRuntime( 3912): at android.location.LocationManager$ListenerTransport._handleMessage(LocationManager.java:191) E/AndroidRuntime( 3912): at android.location.LocationManager$ListenerTransport.access$000(LocationManager.java:124) E/AndroidRuntime( 3912): at android.location.LocationManager$ListenerTransport$1.handleMessage(LocationManager.java:140) E/AndroidRuntime( 3912): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime( 3912): at android.os.Looper.loop(Looper.java:144) E/AndroidRuntime( 3912): at android.app.ActivityThread.main(ActivityThread.java:4937) E/AndroidRuntime( 3912): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 3912): at java.lang.reflect.Method.invoke(Method.java:521) E/AndroidRuntime( 3912): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) E/AndroidRuntime( 3912): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) E/AndroidRuntime( 3912): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • Show MapView on PopupWindow

    - by Ali Nadi
    I want to show MapView on PopupWindow and get error when press-on Map. Please help! Liste.java MapView mapView; View view; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.liste); LayoutInflater mInflater = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE); view = mInflater.inflate(R.layout.pop_up, (ViewGroup) findViewById(R.id.popup_element), false); mapView = (MapView) view.findViewById(R.id.mapview_popup); listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View v, int position, long id) { initiatePopupWindow(earthQuakeList.get(position)); } }); } private void initiatePopupWindow(EqData data) { try { mapView.setBuiltInZoomControls(true); List<Overlay> mapOverlays = mapView.getOverlays(); Drawable marker = this.getResources().getDrawable(R.drawable.marker1); HaritaOverlay itemizedoverlay = new HaritaOverlay(marker, this); Coordination coord = data.getCoordination(); GeoPoint point = new GeoPoint( (int)coord.latitude, (int)coord.longitude); OverlayItem overlayitem = new OverlayItem(point, data.lokasyon, data.name); itemizedoverlay.addOverlay(overlayitem); mapOverlays.add(itemizedoverlay); Display display = getWindowManager().getDefaultDisplay(); pw = new PopupWindow(view, display.getWidth(), display.getHeight()/2, true); // display the popup in the center pw.showAtLocation(view, Gravity.CENTER, 0, display.getHeight()/2); } catch (Exception e) { e.printStackTrace(); } } pop_up.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:baselineAligned="false" android:orientation="vertical" android:weightSum="540" android:id="@+id/popup_element" > ... <LinearLayout android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="440" > <com.google.android.maps.MapView android:id="@+id/mapview_popup" android:layout_width="fill_parent" android:layout_height="fill_parent" android:apiKey="@string/ApiMapKey" android:clickable="true" /> </LinearLayout> Error 07-23 17:36:28.820: E/MapActivity(12413): Couldn't get connection factory client 07-23 17:36:37.760: E/AndroidRuntime(12413): FATAL EXCEPTION: main 07-23 17:36:37.760: E/AndroidRuntime(12413): android.view.WindowManager$BadTokenException: Unable to add window -- token android.view.ViewRoot$W@40590b70 is not valid; is your activity running? 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.ViewRoot.setView(ViewRoot.java:528) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.Window$LocalWindowManager.addView(Window.java:465) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.widget.ZoomButtonsController.setVisible(ZoomButtonsController.java:370) 07-23 17:36:37.760: E/AndroidRuntime(12413): at com.google.android.maps.MapView.displayZoomControls(MapView.java:1053) 07-23 17:36:37.760: E/AndroidRuntime(12413): at com.google.android.maps.MapView$1.onDown(MapView.java:341) 07-23 17:36:37.760: E/AndroidRuntime(12413): at com.google.android.maps.GestureDetector.onTouchEvent(GestureDetector.java:488) 07-23 17:36:37.760: E/AndroidRuntime(12413): at com.google.android.maps.MapView.onTouchEvent(MapView.java:683) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.View.dispatchTouchEvent(View.java:3901) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:903) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:869) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2200) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.view.ViewRoot.handleMessage(ViewRoot.java:1884) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.os.Handler.dispatchMessage(Handler.java:99) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.os.Looper.loop(Looper.java:130) 07-23 17:36:37.760: E/AndroidRuntime(12413): at android.app.ActivityThread.main(ActivityThread.java:3835) 07-23 17:36:37.760: E/AndroidRuntime(12413): at java.lang.reflect.Method.invokeNative(Native Method) 07-23 17:36:37.760: E/AndroidRuntime(12413): at java.lang.reflect.Method.invoke(Method.java:507) 07-23 17:36:37.760: E/AndroidRuntime(12413): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:847) 07-23 17:36:37.760: E/AndroidRuntime(12413): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:605) 07-23 17:36:37.760: E/AndroidRuntime(12413): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • android alarm not able to launch alarm activity

    - by user965830
    I am new to android programming and am trying to make this simple alarm app. I have my code written and it is compiled with no errors. The app runs in the emulator, that is the main activity asks the date and time, but when i click on the confirm button, it displays the message - "Unfortunately, Timer1 has stopped working." The code for my main activity is as follows: public void onClick(View v) { EditText date = (EditText) findViewById(R.id.editDate); EditText month = (EditText) findViewById(R.id.editMonth); EditText hour = (EditText) findViewById(R.id.editHour); EditText min = (EditText) findViewById(R.id.editMin); int dt = Integer.parseInt(date.getText().toString()); int mon = Integer.parseInt(month.getText().toString()); int hr = Integer.parseInt(hour.getText().toString()); int mnt = Integer.parseInt(min.getText().toString()); Intent myIntent = new Intent(MainActivity.this, AlarmActivity.class); pendingIntent = PendingIntent.getService(MainActivity.this, 0, myIntent, 0); AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE); Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.DATE, dt); calendar.set(Calendar.MONTH, mon); calendar.set(Calendar.HOUR, hr); calendar.set(Calendar.MINUTE, mnt); alarmManager.set(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), pendingIntent); } I do not understand what all the errors in logcat mean, so i am posting them: 06-25 16:03:32.175: I/Process(566): Sending signal. PID: 566 SIG: 9 06-25 16:03:53.775: I/dalvikvm(612): threadid=3: reacting to signal 3 06-25 16:03:54.046: I/dalvikvm(612): Wrote stack traces to '/data/anr/traces.txt' 06-25 16:03:54.255: I/dalvikvm(612): threadid=3: reacting to signal 3 06-25 16:03:54.305: I/dalvikvm(612): Wrote stack traces to '/data/anr/traces.txt' 06-25 16:03:54.735: I/dalvikvm(612): threadid=3: reacting to signal 3 06-25 16:03:54.785: I/dalvikvm(612): Wrote stack traces to '/data/anr/traces.txt' 06-25 16:03:54.925: D/gralloc_goldfish(612): Emulator without GPU emulation detected. 06-25 16:05:09.605: D/AndroidRuntime(612): Shutting down VM 06-25 16:05:09.605: W/dalvikvm(612): threadid=1: thread exiting with uncaught exception (group=0x409c01f8) 06-25 16:05:09.685: E/AndroidRuntime(612): FATAL EXCEPTION: main 06-25 16:05:09.685: E/AndroidRuntime(612): java.lang.NumberFormatException: Invalid int: "android.widget.EditText@41030b40" 06-25 16:05:09.685: E/AndroidRuntime(612): at java.lang.Integer.invalidInt(Integer.java:138) 06-25 16:05:09.685: E/AndroidRuntime(612): at java.lang.Integer.parse(Integer.java:375) 06-25 16:05:09.685: E/AndroidRuntime(612): at java.lang.Integer.parseInt(Integer.java:366) 06-25 16:05:09.685: E/AndroidRuntime(612): at java.lang.Integer.parseInt(Integer.java:332) 06-25 16:05:09.685: E/AndroidRuntime(612): at com.kapymay.tversion1.MainActivity$1.onClick(MainActivity.java:34) 06-25 16:05:09.685: E/AndroidRuntime(612): at android.view.View.performClick(View.java:3511) 06-25 16:05:09.685: E/AndroidRuntime(612): at android.view.View$PerformClick.run(View.java:14105) 06-25 16:05:09.685: E/AndroidRuntime(612): at android.os.Handler.handleCallback(Handler.java:605) 06-25 16:05:09.685: E/AndroidRuntime(612): at android.os.Handler.dispatchMessage(Handler.java:92) 06-25 16:05:09.685: E/AndroidRuntime(612): at android.os.Looper.loop(Looper.java:137) 06-25 16:05:09.685: E/AndroidRuntime(612): at android.app.ActivityThread.main(ActivityThread.java:4424) 06-25 16:05:09.685: E/AndroidRuntime(612): at java.lang.reflect.Method.invokeNative(Native Method) 06-25 16:05:09.685: E/AndroidRuntime(612): at java.lang.reflect.Method.invoke(Method.java:511) 06-25 16:05:09.685: E/AndroidRuntime(612): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 06-25 16:05:09.685: E/AndroidRuntime(612): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 06-25 16:05:09.685: E/AndroidRuntime(612): at dalvik.system.NativeStart.main(Native Method) 06-25 16:05:10.445: I/dalvikvm(612): threadid=3: reacting to signal 3 06-25 16:05:10.575: I/dalvikvm(612): Wrote stack traces to '/data/anr/traces.txt'

    Read the article

  • FolderClosed Exception in Javamail

    - by SikhWarrior
    Im trying to create a simple mail client in android, and I have the android version of javamail compiling and running in my app. However, whenever I try to connect and receive mail, I get a Folder Closed exception seen below. 10-23 12:12:13.484: W/System.err(6660): javax.mail.FolderClosedException 10-23 12:12:13.484: W/System.err(6660): at com.sun.mail.imap.IMAPMessage.getProtocol(IMAPMessage.java:149) 10-23 12:12:13.484: W/System.err(6660): at com.sun.mail.imap.IMAPMessage.loadBODYSTRUCTURE(IMAPMessage.java:1262) 10-23 12:12:13.484: W/System.err(6660): at com.sun.mail.imap.IMAPMessage.getDataHandler(IMAPMessage.java:616) 10-23 12:12:13.484: W/System.err(6660): at javax.mail.internet.MimeMessage.getContent(MimeMessage.java:1398) 10-23 12:12:13.484: W/System.err(6660): at com.teamzeta.sfu.Util.MailHelper.getMessageHTML(MailHelper.java:60) 10-23 12:12:13.484: W/System.err(6660): at com.teamzeta.sfu.GetAsyncEmails.onPostExecute(EmailActivity.java:31) 10-23 12:12:13.484: W/System.err(6660): at com.teamzeta.sfu.GetAsyncEmails.onPostExecute(EmailActivity.java:1) 10-23 12:12:13.484: W/System.err(6660): at android.os.AsyncTask.finish(AsyncTask.java:631) 10-23 12:12:13.484: W/System.err(6660): at android.os.AsyncTask.access$600(AsyncTask.java:177) 10-23 12:12:13.484: W/System.err(6660): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644) 10-23 12:12:13.484: W/System.err(6660): at android.os.Handler.dispatchMessage(Handler.java:99) 10-23 12:12:13.484: W/System.err(6660): at android.os.Looper.loop(Looper.java:137) 10-23 12:12:13.484: W/System.err(6660): at android.app.ActivityThread.main(ActivityThread.java:5227) 10-23 12:12:13.484: W/System.err(6660): at java.lang.reflect.Method.invokeNative(Native Method) 10-23 12:12:13.484: W/System.err(6660): at java.lang.reflect.Method.invoke(Method.java:511) 10-23 12:12:13.484: W/System.err(6660): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795) 10-23 12:12:13.484: W/System.err(6660): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562) 10-23 12:12:13.494: W/System.err(6660): at dalvik.system.NativeStart.main(Native Method) My code is as follows: public static Message[] getAllMail(String user, String pwd){ String host = "imap.sfu.ca"; final Message[] NO_MESSAGES = {}; Properties properties = System.getProperties(); properties.setProperty("mail.imap.socketFactory.class", "javax.net.ssl.SSLSocketFactory"); properties.setProperty("mail.imap.socketFactory.port", "993"); Session session = Session.getDefaultInstance(properties); try { Store store = session.getStore("imap"); store.connect(host, user, pwd); Folder folder = store.getFolder("inbox"); folder.open(Folder.READ_ONLY); Message[] messages = folder.getMessages(); folder.close(true); store.close(); Log.d("####TEAM ZETA DEBUG####", "Content: " + messages.length); return messages; } catch (NoSuchProviderException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (MessagingException e) { // TODO Auto-generated catch block e.printStackTrace(); } Log.d("####TEAM ZETA DEBUG####", "Returning NO_MESSAGES"); return NO_MESSAGES; } public static String getMessageHTML(Message message){ Object msgContent; try { msgContent = message.getContent(); if (msgContent instanceof Multipart) { Multipart mp = (Multipart) msgContent; for (int i = 0; i < mp.getCount(); i++) { BodyPart bp = mp.getBodyPart(i); if (Pattern .compile(Pattern.quote("text/html"), Pattern.CASE_INSENSITIVE) .matcher(bp.getContentType()).find()) { // found html part return (String) bp.getContent(); } else { // some other bodypart... } } } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (MessagingException e) { // TODO Auto-generated catch block e.printStackTrace(); } return "Something went wrong"; } I couldn't find anything helpful on the web, does anyone have an ideas why this is happening?? This is called in class GetAsyncEmails extends AsyncTask<String, Integer, Message[]>{ @Override protected Message[] doInBackground(String... args) { // TODO Auto-generated method stub Message[] messages = MailHelper.getAllMail(args[0], args[1]); return messages; } protected void onPostExecute(Message[] result){ if(result.length > 1){ Message message = result[0]; String content = MailHelper.getMessageHTML(message); System.out.println("####TEAM ZETA DEBUG####" + content); } } }

    Read the article

  • CastClassException on Custom View

    - by tuxGurl
    When I try to findViewById() on my custom view I keep getting a ClassCastException. I've tried so many things that I'm sure I've botched the code now! To make sure I'm not going insane I stripped down the classes to their bare minimum inorder to find what was wrong. I'm new to android programming and I'm sure I'm missing something basic. This is BaseImageView an extended view class. package com.company.product.client.android.gui.views; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.view.View; public class BaseImageView extends View { public BaseImageView(Context context) { super(context); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.drawColor(Color.GREEN); } } This is LiveImageView an extension of the BaseImageView class. package com.company.product.client.android.gui.views; import android.content.Context; import android.util.AttributeSet; public class LiveImageView extends BaseImageView { public LiveImageView(Context context, AttributeSet attrs) { super(context); } } Here is the Layout my_view.xml. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center"> <View class="com.company.product.client.android.gui.views.LiveImageView" android:id="@+id/lvImage" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> And here is the onCreate in my Activity LiveViewActivity. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { setContentView(R.layout.my_view); final LiveImageView lvImage = (LiveImageView) findViewById(R.id.lvImage); } catch (final Exception e) { Log.e(TAG, "onCreate() Exception: " + e.toString()); e.printStackTrace(); } Finally, this is stack trace. 02-11 17:25:24.829: ERROR/LiveViewActivity(1942): onCreate() Exception: java.lang.ClassCastException: android.view.View 02-11 17:25:24.839: WARN/System.err(1942): java.lang.ClassCastException: android.view.View 02-11 17:25:24.839: WARN/System.err(1942): at com.company.product.client.android.gui.screen.LiveViewActivity.onCreate(LiveViewActivity.java:26) 02-11 17:25:24.839: WARN/System.err(1942): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 02-11 17:25:24.849: WARN/System.err(1942): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459) 02-11 17:25:24.849: WARN/System.err(1942): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 02-11 17:25:24.849: WARN/System.err(1942): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 02-11 17:25:24.849: WARN/System.err(1942): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 02-11 17:25:24.859: WARN/System.err(1942): at android.os.Handler.dispatchMessage(Handler.java:99) 02-11 17:25:24.859: WARN/System.err(1942): at android.os.Looper.loop(Looper.java:123) 02-11 17:25:24.859: WARN/System.err(1942): at android.app.ActivityThread.main(ActivityThread.java:4363) 02-11 17:25:24.869: WARN/System.err(1942): at java.lang.reflect.Method.invokeNative(Native Method) 02-11 17:25:24.869: WARN/System.err(1942): at java.lang.reflect.Method.invoke(Method.java:521) 02-11 17:25:24.869: WARN/System.err(1942): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 02-11 17:25:24.869: WARN/System.err(1942): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 02-11 17:25:24.879: WARN/System.err(1942): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • NPE when drawing TabWidget in android (only on HTC Magic?)

    - by David Hedlund
    I've received report from the user of an app I've written that he gets FC whenever starting a certain activity. I have not been able to reproduce the issue on the emulator or on my HTC Hero (running 1.5), but this user running HTC Magic (with 1.6) is facing this error every time. What bothers me is that no single step in the stacktrace actually includes any code in my app (com.filmtipset) 01-07 00:10:26.773 I/ActivityManager( 141): Starting activity: Intent { cmp=com.filmtipset/.ViewMovie (has extras) } 01-07 00:10:27.023 D/AndroidRuntime( 2402): Shutting down VM 01-07 00:10:27.023 W/dalvikvm( 2402): threadid=3: thread exiting with uncaught exception (group=0x4001e170) 01-07 00:10:27.023 E/AndroidRuntime( 2402): Uncaught handler: thread main exiting due to uncaught exception 01-07 00:10:27.083 E/AndroidRuntime( 2402): java.lang.NullPointerException 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.widget.TabWidget.dispatchDraw(TabWidget.java:173) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.drawChild(ViewGroup.java:1529) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.drawChild(ViewGroup.java:1529) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.drawChild(ViewGroup.java:1529) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.View.draw(View.java:6552) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.widget.FrameLayout.draw(FrameLayout.java:352) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.drawChild(ViewGroup.java:1531) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1258) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.View.draw(View.java:6552) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.widget.FrameLayout.draw(FrameLayout.java:352) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1883) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewRoot.draw(ViewRoot.java:1332) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewRoot.performTraversals(ViewRoot.java:1097) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.view.ViewRoot.handleMessage(ViewRoot.java:1613) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.os.Handler.dispatchMessage(Handler.java:99) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.os.Looper.loop(Looper.java:123) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at android.app.ActivityThread.main(ActivityThread.java:4320) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at java.lang.reflect.Method.invokeNative(Native Method) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at java.lang.reflect.Method.invoke(Method.java:521) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 01-07 00:10:27.083 E/AndroidRuntime( 2402): at dalvik.system.NativeStart.main(Native Method) Full dump here if I've missed anything of interest I'm guessing, then, that there might be something wrong with my layout. It's quite verbose, so I'm posting it here, rather than pasting the whole thing on SO. There is a tabwidget, where one tab is connected to the scrollview, svFilmInfo, and one to the linear layout llComments. The tab host is populated as such: Drawable commentSelector = getResources().getDrawable(R.drawable.tabcomment); Drawable infoSelector = getResources().getDrawable(R.drawable.tabinfo); mTabHost = getTabHost(); mTabHost.getTabWidget().setBackgroundColor(Color.BLACK); mTabHost.addTab(mTabHost.newTabSpec("tabInfo").setIndicator("Filminfo", infoSelector).setContent(R.id.svFilmInfo)); mTabHost.addTab(mTabHost.newTabSpec("tabInfo").setIndicator("Kommentarer", commentSelector).setContent(R.id.llComments)); Since I cannot reproduce the error myself, and since I cannot find any mention in the stack trace of what might be causing the error, I don't quite know where to start troubleshooting this. I'd appreciate any pointers.

    Read the article

  • Kindle Fire: PopupMenu$OrientationChangeListener leak

    - by dokkaebi
    I have a little popup menu that anchors on a button in the action bar. This works well on 3.0/3.1 Xoom and Galaxy tabs, and a 4.1 Nexus 7. However, on a 7" Fire HD (this one), I get an error about a leaked intent receiver when exiting the application. The error occurs only if the menu was not opened during that run. There is no mention of OrientationChangeListener in the one copy of the source I've found; I suspect Amazon has a different implementation. Questions: Has anyone encountered this? Does anyone know of a workaround or a fix? (Where) can I find Amazon's source code? Finally, (shudder) how important is it that I don't leak a receiver on application exit? Here is the menu xml: <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/menu_profile" android:title="@string/menu_item_profile" ></item> <item android:id="@+id/menu_logout" android:title="@string/menu_item_logout" ></item> </menu> This is where I register it: @Override public boolean onCreateOptionsMenu(Menu menu) { super.onCreateOptionsMenu(menu); MenuInflater inflater = getMenuInflater(); inflater.inflate(R.menu.main_menu, menu); MenuItem login = menu.findItem(R.id.menu_login); Button button = (Button) login.getActionView().findViewById(R.id.login); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { profileMenu.show(); } }); // profileMenu is an instance field profileMenu = new PopupMenu(this, button); inflater.inflate(R.menu.profile_menu, profileMenu.getMenu()); profileMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { public boolean onMenuItemClick(MenuItem item) { // there was code here, but I removed it all and the problem persists return false; } }); return true; } Here is the full stack trace: 10-21 20:55:28.461: E/ActivityThread(4526): Activity **.app.ListActivity has leaked IntentReceiver android.widget.PopupMenu$OrientationChangeListener@422d77e0 that was originally registered here. Are you missing a call to unregisterReceiver()? 10-21 20:55:28.461: E/ActivityThread(4526): android.app.IntentReceiverLeaked: Activity **.app.ListActivity has leaked IntentReceiver android.widget.PopupMenu$OrientationChangeListener@422d77e0 that was originally registered here. Are you missing a call to unregisterReceiver()? 10-21 20:55:28.461: E/ActivityThread(4526): at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:826) 10-21 20:55:28.461: E/ActivityThread(4526): at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:621) 10-21 20:55:28.461: E/ActivityThread(4526): at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1072) 10-21 20:55:28.461: E/ActivityThread(4526): at android.app.ContextImpl.registerReceiver(ContextImpl.java:1059) 10-21 20:55:28.461: E/ActivityThread(4526): at android.app.ContextImpl.registerReceiver(ContextImpl.java:1053) 10-21 20:55:28.461: E/ActivityThread(4526): at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:357) 10-21 20:55:28.461: E/ActivityThread(4526): at android.widget.PopupMenu.<init>(PopupMenu.java:81) 10-21 20:55:28.461: E/ActivityThread(4526): at **.app.ListActivity.onCreateOptionsMenu(ListActivity.java:350) 10-21 20:55:28.461: E/ActivityThread(4526): at android.app.Activity.onCreatePanelMenu(Activity.java:2558) 10-21 20:55:28.461: E/ActivityThread(4526): at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:398) 10-21 20:55:28.461: E/ActivityThread(4526): at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:883) 10-21 20:55:28.461: E/ActivityThread(4526): at com.android.internal.policy.impl.PhoneWindow$2.run(PhoneWindow.java:3008) 10-21 20:55:28.461: E/ActivityThread(4526): at android.os.Handler.handleCallback(Handler.java:605) 10-21 20:55:28.461: E/ActivityThread(4526): at android.os.Handler.dispatchMessage(Handler.java:92) 10-21 20:55:28.461: E/ActivityThread(4526): at android.os.Looper.loop(Looper.java:137) 10-21 20:55:28.461: E/ActivityThread(4526): at android.app.ActivityThread.main(ActivityThread.java:4491) 10-21 20:55:28.461: E/ActivityThread(4526): at java.lang.reflect.Method.invokeNative(Native Method) 10-21 20:55:28.461: E/ActivityThread(4526): at java.lang.reflect.Method.invoke(Method.java:511) 10-21 20:55:28.461: E/ActivityThread(4526): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 10-21 20:55:28.461: E/ActivityThread(4526): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 10-21 20:55:28.461: E/ActivityThread(4526): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • Android Google-Shopping API force closes while parsing

    - by Sam Jackson
    I'm trying to send a request to the Google-Shopping API with the following static method which I think is working: public static String GET_TITLE(String url) throws JSONException { InputStream is = null; String result = ""; JSONObject jArray = null; // http post try { HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(url); HttpResponse response = httpclient.execute(httppost); HttpEntity entity = response.getEntity(); is = entity.getContent(); } catch(Exception e) { Log.e("log_tag", "Error in http connection "+e.toString()); } The URL I'm passing is this BTW: https://www.googleapis.com/shopping/search/v1/public/products/country=US&q=shirts&alt=json &rankBy=relevancy&key=AIzaSyDRKgGmJrdG6pV6DIg2m-nmIbXydxvpjww Next I try to parse this response (where I think the problem comes in) in the same method: try { jArray = new JSONObject(result); } catch(JSONException e){ Log.e("log_tag", "Error parsing data "+e.toString()); } JSONObject itemObject = jArray.getJSONObject("items"); JSONObject productObject = itemObject.getJSONObject("product"); String attributeGoogleId = productObject.getString("googleId"); String attributeProviderId = productObject.getString("providerId"); String attributeTitle = productObject.getString("title");*/ String attributePrice = productObject.getString("price"); JSONObject popupObject = productObject.getJSONObject("popup"); return attributeTitle; } This has been so frustrating, I know it should be simple but everywhere I look I just can't quite get it to work, I'm not exactly sure what the error is since I'm testing it on my HTC Desire because my emulator gives an 'invalid command-line parameter' error when starting, but that's a different issue, anyway, thanks in advance! EDIT: The first one makes it look like there's a problem with the URL, should I change it and see if it makes a difference? 04-01 12:09:05.142: ERROR/log_tag(24968): Error in http connection java.net.UnknownHostException: www.googleapis.com 04-01 12:09:05.142: ERROR/log_tag(24968): Error converting result java.lang.NullPointerException 04-01 12:09:05.142: ERROR/log_tag(24968): Error parsing data org.json.JSONException: End of input at character 0 of 04-01 12:09:05.142: DEBUG/AndroidRuntime(24968): Shutting down VM 04-01 12:09:05.142: WARN/dalvikvm(24968): threadid=1: thread exiting with uncaught exception (group=0x400259f8) 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): FATAL EXCEPTION: main 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=Intent { act=com.google.zxing.client.android.SCAN flg=0x80000 (has extras) }} to activity {com.spectrum.stock/com.spectrum.stock.CaptureActivity}: java.lang.NullPointerException 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): at android.app.ActivityThread.deliverResults(ActivityThread.java:3734) 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3776) 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): at android.app.ActivityThread.access$2800(ActivityThread.java:135) 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2166) 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): at android.os.Handler.dispatchMessage(Handler.java:99) 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): at android.os.Looper.loop(Looper.java:144) 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): at android.app.ActivityThread.main(ActivityThread.java:4937) 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): at java.lang.reflect.Method.invokeNative(Native Method) 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): at java.lang.reflect.Method.invoke(Method.java:521) 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): at dalvik.system.NativeStart.main(Native Method) 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): Caused by: java.lang.NullPointerException 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): at com.spectrum.stock.JSONResponse.GET_TITLE(JSONResponse.java:61) 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): at com.spectrum.stock.CaptureActivity.onActivityResult(CaptureActivity.java:78) 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): at android.app.Activity.dispatchActivityResult(Activity.java:3931) 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): at android.app.ActivityThread.deliverResults(ActivityThread.java:3730) 04-01 12:09:05.152: ERROR/AndroidRuntime(24968): ... 11 more 04-01 12:09:05.162: WARN/ActivityManager(96): Force finishing activity com.spectrum.stock/.CaptureActivity

    Read the article

  • java.lang.OutOfMemoryError: bitmap size exceeds VM budget

    - by Angel
    Hi, I am trying to change the layout of my application from portrait to landscape and vice-versa. But if i do it frequently or more than once then at times my application crashes.. Below is the error log. Please suggest what can be done? < 01-06 09:52:27.787: ERROR/dalvikvm-heap(17473): 1550532-byte external allocation too large for this process. 01-06 09:52:27.787: ERROR/dalvikvm(17473): Out of memory: Heap Size=6471KB, Allocated=4075KB, Bitmap Size=9564KB 01-06 09:52:27.787: ERROR/(17473): VM won't let us allocate 1550532 bytes 01-06 09:52:27.798: DEBUG/skia(17473): --- decoder-decode returned false 01-06 09:52:27.798: DEBUG/AndroidRuntime(17473): Shutting down VM 01-06 09:52:27.798: WARN/dalvikvm(17473): threadid=3: thread exiting with uncaught exception (group=0x4001e390) 01-06 09:52:27.807: ERROR/AndroidRuntime(17473): Uncaught handler: thread main exiting due to uncaught exception 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): java.lang.RuntimeException: Unable to start activity ComponentInfo{}: android.view.InflateException: Binary XML file line #2: Error inflating class 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3812) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.app.ActivityThread.access$2300(ActivityThread.java:126) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1936) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.os.Handler.dispatchMessage(Handler.java:99) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.os.Looper.loop(Looper.java:123) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.app.ActivityThread.main(ActivityThread.java:4595) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at java.lang.reflect.Method.invokeNative(Native Method) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at java.lang.reflect.Method.invoke(Method.java:521) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at dalvik.system.NativeStart.main(Native Method) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.view.LayoutInflater.createView(LayoutInflater.java:513) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.view.LayoutInflater.inflate(LayoutInflater.java:385) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:207) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.app.Activity.setContentView(Activity.java:1629) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at onCreate(Game.java:98) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): ... 12 more 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): Caused by: java.lang.reflect.InvocationTargetException 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.widget.LinearLayout.(LinearLayout.java:92) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at java.lang.reflect.Constructor.constructNative(Native Method) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at java.lang.reflect.Constructor.newInstance(Constructor.java:446) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.view.LayoutInflater.createView(LayoutInflater.java:500) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): ... 22 more 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:464) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:340) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:697) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.content.res.Resources.loadDrawable(Resources.java:1705) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.content.res.TypedArray.getDrawable(TypedArray.java:548) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.view.View.(View.java:1850) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.view.View.(View.java:1799) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): at android.view.ViewGroup.(ViewGroup.java:296) 01-06 09:52:27.857: ERROR/AndroidRuntime(17473): ... 26 more

    Read the article

  • Database call crashes Android Application

    - by Darren Murtagh
    i am using a Android database and its set up but when i call in within an onClickListener and the app crashes the code i am using is mButton.setOnClickListener( new View.OnClickListener() { public void onClick(View view) { s = WorkoutChoice.this.weight.getText().toString(); s2 = WorkoutChoice.this.height.getText().toString(); int w = Integer.parseInt(s); double h = Double.parseDouble(s2); double BMI = (w/h)/h; t.setText(""+BMI); long id = db.insertTitle("001", ""+days, ""+BMI); Cursor c = db.getAllTitles(); if (c.moveToFirst()) { do { DisplayTitle(c); } while (c.moveToNext()); } } }); and the log cat for when i run it is: 04-01 18:21:54.704: E/global(6333): Deprecated Thread methods are not supported. 04-01 18:21:54.704: E/global(6333): java.lang.UnsupportedOperationException 04-01 18:21:54.704: E/global(6333): at java.lang.VMThread.stop(VMThread.java:85) 04-01 18:21:54.704: E/global(6333): at java.lang.Thread.stop(Thread.java:1391) 04-01 18:21:54.704: E/global(6333): at java.lang.Thread.stop(Thread.java:1356) 04-01 18:21:54.704: E/global(6333): at com.b00348312.workout.Splashscreen$1.run(Splashscreen.java:42) 04-01 18:22:09.444: D/dalvikvm(6333): GC_FOR_MALLOC freed 4221 objects / 252640 bytes in 31ms 04-01 18:22:09.474: I/dalvikvm(6333): Total arena pages for JIT: 11 04-01 18:22:09.574: D/dalvikvm(6333): GC_FOR_MALLOC freed 1304 objects / 302920 bytes in 29ms 04-01 18:22:09.744: D/dalvikvm(6333): GC_FOR_MALLOC freed 2480 objects / 290848 bytes in 33ms 04-01 18:22:10.034: D/dalvikvm(6333): GC_FOR_MALLOC freed 6334 objects / 374152 bytes in 36ms 04-01 18:22:14.344: D/AndroidRuntime(6333): Shutting down VM 04-01 18:22:14.344: W/dalvikvm(6333): threadid=1: thread exiting with uncaught exception (group=0x400259f8) 04-01 18:22:14.364: E/AndroidRuntime(6333): FATAL EXCEPTION: main 04-01 18:22:14.364: E/AndroidRuntime(6333): java.lang.IllegalStateException: database not open 04-01 18:22:14.364: E/AndroidRuntime(6333): at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1567) 04-01 18:22:14.364: E/AndroidRuntime(6333): at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1484) 04-01 18:22:14.364: E/AndroidRuntime(6333): at com.b00348312.workout.DataBaseHelper.insertTitle(DataBaseHelper.java:84) 04-01 18:22:14.364: E/AndroidRuntime(6333): at com.b00348312.workout.WorkoutChoice$3.onClick(WorkoutChoice.java:84) 04-01 18:22:14.364: E/AndroidRuntime(6333): at android.view.View.performClick(View.java:2408) 04-01 18:22:14.364: E/AndroidRuntime(6333): at android.view.View$PerformClick.run(View.java:8817) 04-01 18:22:14.364: E/AndroidRuntime(6333): at android.os.Handler.handleCallback(Handler.java:587) 04-01 18:22:14.364: E/AndroidRuntime(6333): at android.os.Handler.dispatchMessage(Handler.java:92) 04-01 18:22:14.364: E/AndroidRuntime(6333): at android.os.Looper.loop(Looper.java:144) 04-01 18:22:14.364: E/AndroidRuntime(6333): at android.app.ActivityThread.main(ActivityThread.java:4937) 04-01 18:22:14.364: E/AndroidRuntime(6333): at java.lang.reflect.Method.invokeNative(Native Method) 04-01 18:22:14.364: E/AndroidRuntime(6333): at java.lang.reflect.Method.invoke(Method.java:521) 04-01 18:22:14.364: E/AndroidRuntime(6333): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858) 04-01 18:22:14.364: E/AndroidRuntime(6333): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) 04-01 18:22:14.364: E/AndroidRuntime(6333): at dalvik.system.NativeStart.main(Native Method) i have notice errors when the application opens but i dont no what thet are from. when i take out the statements to do with the database there is no errors and everthign runs smoothly

    Read the article

  • Android passing an arraylist back to parent activity

    - by Nicklas O
    Hi there. I've been searching for a simple example of this with no luck. In my android application I have two activities: 1. The main activity which is launched at startup 2. A second activity which is launched by pressing a button on the main activty. When the second activity is finished (by pressing a button) I want it to send back an ArrayList of type MyObject to the main activity and close itself, which the main activity can then do whatever with it. How would I go about achieving this? I have been trying a few things but it is crashing my application when I start the second activity. When the user presses button to launch second activity: Intent i = new Intent(MainActivity.this, secondactivity.class); startActivityForResult(i, 1); The array which is bundled back after pressing a button on the second activity: Intent intent= getIntent(); Bundle b = new Bundle(); b.putParcelableArrayList("myarraylist", mylist); intent.putExtras(b); setResult(RESULT_OK, intent); finish(); And finally a listener on the main activity (although I'm not sure of 100% when this code launches...) protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if(resultCode==RESULT_OK && requestCode==1){ Bundle extras = data.getExtras(); final ArrayList<MyObject> mylist = extras.getParcelableArrayList("myarraylist"); Toast.makeText(MainActivity.this, mylist.get(0).getName(), Toast.LENGTH_SHORT).show(); } } Any ideas where I am going wrong? The onActivityResult() seems to be crashing my application. EDIT: This is my class MyObject, its called plan and has a name and an id import android.os.Parcel; import android.os.Parcelable; public class Plan implements Parcelable{ private String name; private String id; public Plan(){ } public Plan(String name, String id){ this.name = name; this.id = id; } public String getName(){ return name; } public void setName(String name){ this.name = name; } public String getId(){ return id; } public void setId(String id){ this.id = id; } public String toString(){ return "Plan ID: " + id + " Plan Name: " + name; } @Override public int describeContents() { // TODO Auto-generated method stub return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeString(id); dest.writeString(name); } public static final Parcelable.Creator<Plan> CREATOR = new Parcelable.Creator<Plan>() { public Plan createFromParcel(Parcel in) { return new Plan(); } @Override public Plan[] newArray(int size) { // TODO Auto-generated method stub return new Plan[size]; } }; } This is my logcat E/AndroidRuntime( 293): java.lang.RuntimeException: Unable to instantiate activ ity ComponentInfo{com.daniel.android.groupproject/com.me.android.projec t.secondactivity}: java.lang.NullPointerException E/AndroidRuntime( 293): at android.app.ActivityThread.performLaunchActiv ity(ActivityThread.java:2417) E/AndroidRuntime( 293): at android.app.ActivityThread.handleLaunchActivi ty(ActivityThread.java:2512) E/AndroidRuntime( 293): at android.app.ActivityThread.access$2200(Activi tyThread.java:119) E/AndroidRuntime( 293): at android.app.ActivityThread$H.handleMessage(Ac tivityThread.java:1863) E/AndroidRuntime( 293): at android.os.Handler.dispatchMessage(Handler.ja va:99) E/AndroidRuntime( 293): at android.os.Looper.loop(Looper.java:123) E/AndroidRuntime( 293): at android.app.ActivityThread.main(ActivityThrea d.java:4363) E/AndroidRuntime( 293): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime( 293): at java.lang.reflect.Method.invoke(Method.java:5 21) E/AndroidRuntime( 293): at com.android.internal.os.ZygoteInit$MethodAndA rgsCaller.run(ZygoteInit.java:860) E/AndroidRuntime( 293): at com.android.internal.os.ZygoteInit.main(Zygot eInit.java:618) E/AndroidRuntime( 293): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime( 293): Caused by: java.lang.NullPointerException E/AndroidRuntime( 293): at com.daniel.android.groupproject.login.<init>( login.java:51) E/AndroidRuntime( 293): at java.lang.Class.newInstanceImpl(Native Method ) E/AndroidRuntime( 293): at java.lang.Class.newInstance(Class.java:1479) E/AndroidRuntime( 293): at android.app.Instrumentation.newActivity(Instr umentation.java:1021) E/AndroidRuntime( 293): at android.app.ActivityThread.performLaunchActiv ity(ActivityThread.java:2409) E/AndroidRuntime( 293): ... 11 more

    Read the article

  • null pointer exception when starting new activity

    - by acithium
    Okay, I'm getting a null pointer exception when I start my third activity. Here is the LogCat message: 12-28 04:38:00.350: ERROR/AndroidRuntime(776): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.acithium.main/com.acithium.rss.ShowDescription}: java.lang.NullPointerException 12-28 04:38:00.350: ERROR/AndroidRuntime(776): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2401) 12-28 04:38:00.350: ERROR/AndroidRuntime(776): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417) 12-28 04:38:00.350: ERROR/AndroidRuntime(776): at android.app.ActivityThread.access$2100(ActivityThread.java:116) 12-28 04:38:00.350: ERROR/AndroidRuntime(776): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794) 12-28 04:38:00.350: ERROR/AndroidRuntime(776): at android.os.Handler.dispatchMessage(Handler.java:99) 12-28 04:38:00.350: ERROR/AndroidRuntime(776): at android.os.Looper.loop(Looper.java:123) 12-28 04:38:00.350: ERROR/AndroidRuntime(776): at android.app.ActivityThread.main(ActivityThread.java:4203) 12-28 04:38:00.350: ERROR/AndroidRuntime(776): at java.lang.reflect.Method.invokeNative(Native Method) 12-28 04:38:00.350: ERROR/AndroidRuntime(776): at java.lang.reflect.Method.invoke(Method.java:521) 12-28 04:38:00.350: ERROR/AndroidRuntime(776): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 12-28 04:38:00.350: ERROR/AndroidRuntime(776): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 12-28 04:38:00.350: ERROR/AndroidRuntime(776): at dalvik.system.NativeStart.main(Native Method) 12-28 04:38:00.350: ERROR/AndroidRuntime(776): Caused by: java.lang.NullPointerException 12-28 04:38:00.350: ERROR/AndroidRuntime(776): at com.acithium.rss.ShowDescription.onCreate(ShowDescription.java:48) 12-28 04:38:00.350: ERROR/AndroidRuntime(776): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123) 12-28 04:38:00.350: ERROR/AndroidRuntime(776): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364) 12-28 04:38:00.350: ERROR/AndroidRuntime(776): ... 11 more Here is the section of code where I call the activity: public void onItemClick(AdapterView parent, View v, int position, long id) { Log.i(tag,"item clicked! [" + feed.getItem(position).getTitle() + "]"); Intent itemintent = new Intent(this,com.acithium.rss.ShowDescription.class); //Intent itemintent = new Intent(); //itemintent.setClassName("com.acithium.main", "com.acithium.rss.ShowDescription"); Bundle b = new Bundle(); b.putString("title", feed.getItem(position).getTitle()); b.putString("description", feed.getItem(position).getDescription()); b.putString("link", feed.getItem(position).getLink()); itemintent.putExtra("android.intent.extra.INTENT", b); startActivityForResult(itemintent,0); } And here is new activity class that is called: public class ShowDescription extends Activity { public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.showdescription); String theStory = null; Intent startingIntent = getIntent(); if (startingIntent != null) { Bundle b = startingIntent.getBundleExtra("android.intent.extra.INTENT"); if (b == null) { theStory = "bad bundle?"; } else { theStory = b.getString("title") + "\n\n" + b.getString("description") + "\n\nMore information:\n" + b.getString("link"); } } else { theStory = "Information Not Found."; } TextView db= (TextView) findViewById(R.id.storybox); db.setText(theStory); Button backbutton = (Button) findViewById(R.id.back); backbutton.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { finish(); } }); } }

    Read the article

  • Android: Showing photos runs out of memory

    - by Tom Beech
    I'm using a dialog box to display images in my android project. The first one opens fine, but when I close it and do the process again to show a different one the app falls over with a memory error (it's running on a samsung galaxy s3 - so shouldnt be an issue). Error: 10-24 11:25:45.575: E/dalvikvm-heap(29194): Out of memory on a 31961104-byte allocation. 10-24 11:25:45.580: E/AndroidRuntime(29194): FATAL EXCEPTION: main 10-24 11:25:45.580: E/AndroidRuntime(29194): java.lang.OutOfMemoryError 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:587) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:389) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.graphics.BitmapFactory.decodeFile(BitmapFactory.java:418) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.graphics.drawable.Drawable.createFromPath(Drawable.java:882) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.widget.ImageView.resolveUri(ImageView.java:569) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.widget.ImageView.setImageURI(ImageView.java:340) 10-24 11:25:45.580: E/AndroidRuntime(29194): at com.directenquiries.assessment.tool.AddAsset.loadPhoto(AddAsset.java:771) 10-24 11:25:45.580: E/AndroidRuntime(29194): at com.directenquiries.assessment.tool.AddAsset$11.onClick(AddAsset.java:748) 10-24 11:25:45.580: E/AndroidRuntime(29194): at com.android.internal.app.AlertController$AlertParams$3.onItemClick(AlertController.java:936) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.widget.AdapterView.performItemClick(AdapterView.java:292) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.widget.AbsListView.performItemClick(AbsListView.java:1359) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.widget.AbsListView$PerformClick.run(AbsListView.java:2988) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.widget.AbsListView$1.run(AbsListView.java:3783) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.os.Handler.handleCallback(Handler.java:605) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.os.Handler.dispatchMessage(Handler.java:92) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.os.Looper.loop(Looper.java:137) 10-24 11:25:45.580: E/AndroidRuntime(29194): at android.app.ActivityThread.main(ActivityThread.java:4517) 10-24 11:25:45.580: E/AndroidRuntime(29194): at java.lang.reflect.Method.invokeNative(Native Method) 10-24 11:25:45.580: E/AndroidRuntime(29194): at java.lang.reflect.Method.invoke(Method.java:511) 10-24 11:25:45.580: E/AndroidRuntime(29194): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993) 10-24 11:25:45.580: E/AndroidRuntime(29194): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760) 10-24 11:25:45.580: E/AndroidRuntime(29194): at dalvik.system.NativeStart.main(Native Method) Loading code: public void loadPhotoList(){ Cursor f = db.rawQuery("select * from stationphotos where StationObjectID = '"+ checkStationObjectID + "'", null); final ArrayList<String> mHelperNames= new ArrayList<String>(); if(f.getCount() != 0) { f.moveToFirst(); f.moveToFirst(); while(!f.isAfterLast()) { mHelperNames.add(f.getString(f.getColumnIndex("FilePath"))); f.moveToNext(); } } f.close(); final String [] nameStrings = new String [mHelperNames.size()]; for(int i=0; i<mHelperNames.size(); i++) nameStrings[i] = mHelperNames.get(i).toString(); AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Select Picture"); builder.setItems(nameStrings, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { loadPhoto(mHelperNames.get(item).toString()); } }); AlertDialog alert = builder.create(); alert.show(); } public void loadPhoto(String imagepath){ Dialog dialog = new Dialog(this); dialog.setContentView(R.layout.activity_show_image); dialog.setTitle("Image"); dialog.setCancelable(true); ImageView img = (ImageView) dialog.findViewById(R.id.imageView1); img.setImageResource(R.drawable.ico_partial); Uri imgUri = Uri.parse(imagepath); img.setImageURI(imgUri); dialog.show(); }

    Read the article

  • After downloading an application with two Launcher components from the Marketplace, clicking "Open"

    - by user267728
    Create a sample application with two launcher icons. For example, two components such as: <application ...> <activity ... android:name="TestActivity01"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity ... android:name="TestActivity02"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> Either install the application via downloading from the Marketplace, or via AppInstaller. When the message box asks you if you would like to run the application, an exception is thrown: 02-03 16:42:44.270: ERROR/AndroidRuntime(395): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.xxx.xxx/com.android.internal.app.ResolverActivity}; have you declared this activity in your AndroidManifest.xml? 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1 480) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1454) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at android.app.Activity.startActivityForResult(Activity.java:2660) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at android.app.Activity.startActivity(Activity.java:2704) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at com.android.packageinstaller.InstallAppDone.onClick(InstallAppDone.java:105 ) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at android.view.View.performClick(View.java:2344) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at android.view.View.onTouchEvent(View.java:4133) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at android.widget.TextView.onTouchEvent(TextView.java:6504) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at android.view.View.dispatchTouchEvent(View.java:3672) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEv ent(PhoneWindow.java:1712) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneW indow.java:1202) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at android.app.Activity.dispatchTouchEvent(Activity.java:1987) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(P honeWindow.java:1696) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at android.view.ViewRoot.handleMessage(ViewRoot.java:1658) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at android.os.Handler.dispatchMessage(Handler.java:99) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at android.os.Looper.loop(Looper.java:123) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at android.app.ActivityThread.main(ActivityThread.java:4203) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at java.lang.reflect.Method.invokeNative(Native Method) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at java.lang.reflect.Method.invoke(Method.java:521) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java: 791) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 02-03 16:42:44.270: ERROR/AndroidRuntime(395): at dalvik.system.NativeStart.main(Native Method) The crash happens because com.android.internal.app.ResolverActivity is trying to find a (single) component which resolves the following intent: <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> Please note that this has been tested BOTH with the AppInstaller, and the actual Marketplace on a real device.

    Read the article

  • I try to change activity to next page, but it can't.

    - by Daisy
    I try to change page on android application. It have error but look like its swap a little while. public class gps_gui extends Activity implements View.OnClickListener{ /** Called when the activity is first created. */ private static final int ACTIVITY_CREATE = 0; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final Button login = (Button) findViewById(R.id.login); login.setOnClickListener((OnClickListener) this); } public void onClick(View v){ //Toast.makeText(this, "Already Login",Toast.LENGTH_SHORT).show(); Intent i = new Intent(this, SecondPage.class); startActivityForResult(i, ACTIVITY_CREATE); } } public class SecondPage extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.second_page); } } In AndriodManifest.xml <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="gps.GUI" android:versionCode="1" android:versionName="1.0"> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name=".gps_gui" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="second_page"></activity> </application> <uses-sdk android:minSdkVersion="8" /> </manifest> Anyone can help me ? thanks Errors: 01-29 13:56:57.709: ERROR/AndroidRuntime(393): FATAL EXCEPTION: main 01-29 13:56:57.709: ERROR/AndroidRuntime(393): android.content.ActivityNotFoundException: Unable to find explicit activity class {gps.GUI/gps.GUI.SecondPage}; have you declared this activity in your AndroidManifest.xml? 01-29 13:56:57.709: ERROR/AndroidRuntime(393): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1404) 01-29 13:56:57.709: ERROR/AndroidRuntime(393): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1378) 01-29 13:56:57.709: ERROR/AndroidRuntime(393): at android.app.Activity.startActivityForResult(Activity.java:2817) 01-29 13:56:57.709: ERROR/AndroidRuntime(393): at gps.GUI.gps_gui$1.onClick(gps_gui.java:30) 01-29 13:56:57.709: ERROR/AndroidRuntime(393): at android.view.View.performClick(View.java:2408) 01-29 13:56:57.709: ERROR/AndroidRuntime(393): at android.view.View$PerformClick.run(View.java:8816) 01-29 13:56:57.709: ERROR/AndroidRuntime(393): at android.os.Handler.handleCallback(Handler.java:587) 01-29 13:56:57.709: ERROR/AndroidRuntime(393): at android.os.Handler.dispatchMessage(Handler.java:92) 01-29 13:56:57.709: ERROR/AndroidRuntime(393): at android.os.Looper.loop(Looper.java:123) 01-29 13:56:57.709: ERROR/AndroidRuntime(393): at android.app.ActivityThread.main(ActivityThread.java:4627) 01-29 13:56:57.709: ERROR/AndroidRuntime(393): at java.lang.reflect.Method.invokeNative(Native Method) 01-29 13:56:57.709: ERROR/AndroidRuntime(393): at java.lang.reflect.Method.invoke(Method.java:521) 01-29 13:56:57.709: ERROR/AndroidRuntime(393): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 01-29 13:56:57.709: ERROR/AndroidRuntime(393): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 01-29 13:56:57.709: ERROR/AndroidRuntime(393): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • Force close when starting new activity

    - by Alex
    I'm trying to launch a new activity from my main activity, but I just get error codes all the time. Heres my main activity; public class gunstats extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button button4 = (Button)findViewById(R.id.button4); button4.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { Intent intent = new Intent(gunstats.this, more.class); startActivity(intent); } }); } } and the activity that is being called from my main class; public class more extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); final MediaPlayer mp = MediaPlayer.create(this, R.raw.deagle); Button buttonm1 = (Button)this.findViewById(R.id.buttonm1); buttonm1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { mp.start(); } }); } } And there's nothing wrong in the manifest Heres my logcat: 01-08 16:33:17.647: ERROR/AndroidRuntime(552): Uncaught handler: thread main exiting due to uncaught exception 01-08 16:33:17.676: ERROR/AndroidRuntime(552): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.gunstats/com.gunstats.more}; have you declared this activity in your AndroidManifest.xml? 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1480) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1454) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.app.Activity.startActivityForResult(Activity.java:2660) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.app.Activity.startActivity(Activity.java:2704) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at com.gunstats.gunstats$4.onClick(gunstats.java:64) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.View.performClick(View.java:2344) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.View.onTouchEvent(View.java:4133) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.widget.TextView.onTouchEvent(TextView.java:6504) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.View.dispatchTouchEvent(View.java:3672) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:882) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1712) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1202) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.app.Activity.dispatchTouchEvent(Activity.java:1987) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1696) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.view.ViewRoot.handleMessage(ViewRoot.java:1658) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.os.Handler.dispatchMessage(Handler.java:99) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.os.Looper.loop(Looper.java:123) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at android.app.ActivityThread.main(ActivityThread.java:4203) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at java.lang.reflect.Method.invokeNative(Native Method) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at java.lang.reflect.Method.invoke(Method.java:521) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549) 01-08 16:33:17.676: ERROR/AndroidRuntime(552): at dalvik.system.NativeStart.main(Native Method) What is causing this force close?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10  | Next Page >