Getting an error while passing arraylist through intent - android

Hi I am new to android any one help me out from this error...
my code looks like
wheelArrayList = (ArrayList<String>) bundle.get("listData");
Logcat:
03-15 18:29:54.967: E/AndroidRuntime(527): FATAL EXCEPTION: main
03-15 18:29:54.967: E/AndroidRuntime(527): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.pack.customadpterforendless/com.pack.customadpterforendless.MainActivity}: java.lang.ClassCastException: java.lang.String
03-15 18:29:54.967: E/AndroidRuntime(527): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
03-15 18:29:54.967: E/AndroidRuntime(527): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
03-15 18:29:54.967: E/AndroidRuntime(527): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
03-15 18:29:54.967: E/AndroidRuntime(527): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
03-15 18:29:54.967: E/AndroidRuntime(527): at android.os.Handler.dispatchMessage(Handler.java:99)
03-15 18:29:54.967: E/AndroidRuntime(527): at android.os.Looper.loop(Looper.java:123)
03-15 18:29:54.967: E/AndroidRuntime(527): at android.app.ActivityThread.main(ActivityThread.java:4627)
03-15 18:29:54.967: E/AndroidRuntime(527): at java.lang.reflect.Method.invokeNative(Native Method)
03-15 18:29:54.967: E/AndroidRuntime(527): at java.lang.reflect.Method.invoke(Method.java:521)
03-15 18:29:54.967: E/AndroidRuntime(527): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-15 18:29:54.967: E/AndroidRuntime(527): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-15 18:29:54.967: E/AndroidRuntime(527): at dalvik.system.NativeStart.main(Native Method)
03-15 18:29:54.967: E/AndroidRuntime(527): Caused by: java.lang.ClassCastException: java.lang.String
03-15 18:29:54.967: E/AndroidRuntime(527): at com.pack.customadpterforendless.MainActivity.onCreate(MainActivity.java:42)
03-15 18:29:54.967: E/AndroidRuntime(527): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-15 18:29:54.967: E/AndroidRuntime(527): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
03-15 18:29:54.967: E/AndroidRuntime(527): ... 11 more

You should use
getIntent().getXXXArrayListExtra("Name");
Where XXX represents the type of objects what ArraList contains, For Example if your ArrayList is a list of Strings, then use
getIntent().getStringArrayListExtra("Name");

Related

App has Stopped unexpectedly

I try to run google map from this page https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2
This is my
.java page
package com.findyourtaxihere.taxi;
import android.app.Activity;
import android.os.Bundle;
public class MainActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
This is Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.findyourtaxihere.taxi"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<permission
android:name="com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-permission android:name="com.vogella.android.locationapi.maps.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.my api"
android:value="my api"/>
</application>
</manifest>
my activity main
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"/>
when run my app , it shows error like this stops unfortunately , and i'm new for android please help me !
log
02-02 19:03:54.871: I/Process(284): Sending signal. PID: 284 SIG: 9
02-02 19:04:00.491: D/AndroidRuntime(307): Shutting down VM
02-02 19:04:00.491: W/dalvikvm(307): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:04:00.511: E/AndroidRuntime(307): FATAL EXCEPTION: main
02-02 19:04:00.511: E/AndroidRuntime(307): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:04:00.511: E/AndroidRuntime(307): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.os.Looper.loop(Looper.java:123)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:04:00.511: E/AndroidRuntime(307): at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:04:00.511: E/AndroidRuntime(307): at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:04:00.511: E/AndroidRuntime(307): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:04:00.511: E/AndroidRuntime(307): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:04:00.511: E/AndroidRuntime(307): at dalvik.system.NativeStart.main(Native Method)
02-02 19:04:00.511: E/AndroidRuntime(307): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:04:00.511: E/AndroidRuntime(307): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:04:00.511: E/AndroidRuntime(307): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:04:00.511: E/AndroidRuntime(307): at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:13)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:04:00.511: E/AndroidRuntime(307): ... 11 more
02-02 19:04:00.511: E/AndroidRuntime(307): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-2.apk]
02-02 19:04:00.511: E/AndroidRuntime(307): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:04:00.511: E/AndroidRuntime(307): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:04:00.511: E/AndroidRuntime(307): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:04:00.511: E/AndroidRuntime(307): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:04:00.511: E/AndroidRuntime(307): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:04:00.511: E/AndroidRuntime(307): ... 19 more
02-02 19:09:36.841: I/dalvikvm(334): Could not find method com.findyourtaxihere.taxi.MainActivity.getFragmentManager, referenced from method com.findyourtaxihere.taxi.MainActivity.onCreate
02-02 19:09:36.841: W/dalvikvm(334): VFY: unable to resolve virtual method 12505: Lcom/findyourtaxihere/taxi/MainActivity;.getFragmentManager ()Landroid/app/FragmentManager;
02-02 19:09:36.841: D/dalvikvm(334): VFY: replacing opcode 0x6e at 0x0009
02-02 19:09:36.852: D/dalvikvm(334): VFY: dead code 0x000c-0019 in Lcom/findyourtaxihere/taxi/MainActivity;.onCreate (Landroid/os/Bundle;)V
02-02 19:09:36.922: D/AndroidRuntime(334): Shutting down VM
02-02 19:09:36.922: W/dalvikvm(334): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:09:36.942: E/AndroidRuntime(334): FATAL EXCEPTION: main
02-02 19:09:36.942: E/AndroidRuntime(334): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:09:36.942: E/AndroidRuntime(334): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.os.Looper.loop(Looper.java:123)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:09:36.942: E/AndroidRuntime(334): at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:09:36.942: E/AndroidRuntime(334): at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:09:36.942: E/AndroidRuntime(334): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:09:36.942: E/AndroidRuntime(334): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:09:36.942: E/AndroidRuntime(334): at dalvik.system.NativeStart.main(Native Method)
02-02 19:09:36.942: E/AndroidRuntime(334): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:09:36.942: E/AndroidRuntime(334): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:09:36.942: E/AndroidRuntime(334): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:09:36.942: E/AndroidRuntime(334): at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:18)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:09:36.942: E/AndroidRuntime(334): ... 11 more
02-02 19:09:36.942: E/AndroidRuntime(334): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-1.apk]
02-02 19:09:36.942: E/AndroidRuntime(334): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:09:36.942: E/AndroidRuntime(334): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:09:36.942: E/AndroidRuntime(334): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:09:36.942: E/AndroidRuntime(334): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:09:36.942: E/AndroidRuntime(334): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:09:36.942: E/AndroidRuntime(334): ... 19 more
02-02 19:09:40.241: I/Process(334): Sending signal. PID: 334 SIG: 9
02-02 19:15:23.312: I/dalvikvm(370): Could not find method com.findyourtaxihere.taxi.MainActivity.getFragmentManager, referenced from method com.findyourtaxihere.taxi.MainActivity.onCreate
02-02 19:15:23.312: W/dalvikvm(370): VFY: unable to resolve virtual method 12505: Lcom/findyourtaxihere/taxi/MainActivity;.getFragmentManager ()Landroid/app/FragmentManager;
02-02 19:15:23.312: D/dalvikvm(370): VFY: replacing opcode 0x6e at 0x0009
02-02 19:15:23.322: D/dalvikvm(370): VFY: dead code 0x000c-0019 in Lcom/findyourtaxihere/taxi/MainActivity;.onCreate (Landroid/os/Bundle;)V
02-02 19:15:23.392: D/AndroidRuntime(370): Shutting down VM
02-02 19:15:23.392: W/dalvikvm(370): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:15:23.422: E/AndroidRuntime(370): FATAL EXCEPTION: main
02-02 19:15:23.422: E/AndroidRuntime(370): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:15:23.422: E/AndroidRuntime(370): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.os.Looper.loop(Looper.java:123)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:15:23.422: E/AndroidRuntime(370): at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:15:23.422: E/AndroidRuntime(370): at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:15:23.422: E/AndroidRuntime(370): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:15:23.422: E/AndroidRuntime(370): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:15:23.422: E/AndroidRuntime(370): at dalvik.system.NativeStart.main(Native Method)
02-02 19:15:23.422: E/AndroidRuntime(370): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:15:23.422: E/AndroidRuntime(370): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:15:23.422: E/AndroidRuntime(370): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:15:23.422: E/AndroidRuntime(370): at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:18)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:15:23.422: E/AndroidRuntime(370): ... 11 more
02-02 19:15:23.422: E/AndroidRuntime(370): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-2.apk]
02-02 19:15:23.422: E/AndroidRuntime(370): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:15:23.422: E/AndroidRuntime(370): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:15:23.422: E/AndroidRuntime(370): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:15:23.422: E/AndroidRuntime(370): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:15:23.422: E/AndroidRuntime(370): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:15:23.422: E/AndroidRuntime(370): ... 19 more
02-02 19:15:26.542: I/Process(370): Sending signal. PID: 370 SIG: 9
02-02 19:18:15.771: I/dalvikvm(397): Could not find method com.findyourtaxihere.taxi.MainActivity.getFragmentManager, referenced from method com.findyourtaxihere.taxi.MainActivity.onCreate
02-02 19:18:15.771: W/dalvikvm(397): VFY: unable to resolve virtual method 12506: Lcom/findyourtaxihere/taxi/MainActivity;.getFragmentManager ()Landroid/app/FragmentManager;
02-02 19:18:15.771: D/dalvikvm(397): VFY: replacing opcode 0x6e at 0x0009
02-02 19:18:15.782: D/dalvikvm(397): VFY: dead code 0x000c-005e in Lcom/findyourtaxihere/taxi/MainActivity;.onCreate (Landroid/os/Bundle;)V
02-02 19:18:15.821: D/AndroidRuntime(397): Shutting down VM
02-02 19:18:15.821: W/dalvikvm(397): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:18:15.851: E/AndroidRuntime(397): FATAL EXCEPTION: main
02-02 19:18:15.851: E/AndroidRuntime(397): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:18:15.851: E/AndroidRuntime(397): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.os.Looper.loop(Looper.java:123)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:18:15.851: E/AndroidRuntime(397): at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:18:15.851: E/AndroidRuntime(397): at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:18:15.851: E/AndroidRuntime(397): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:18:15.851: E/AndroidRuntime(397): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:18:15.851: E/AndroidRuntime(397): at dalvik.system.NativeStart.main(Native Method)
02-02 19:18:15.851: E/AndroidRuntime(397): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:18:15.851: E/AndroidRuntime(397): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:18:15.851: E/AndroidRuntime(397): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:18:15.851: E/AndroidRuntime(397): at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:20)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:18:15.851: E/AndroidRuntime(397): ... 11 more
02-02 19:18:15.851: E/AndroidRuntime(397): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-1.apk]
02-02 19:18:15.851: E/AndroidRuntime(397): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:18:15.851: E/AndroidRuntime(397): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:18:15.851: E/AndroidRuntime(397): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:18:15.851: E/AndroidRuntime(397): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:18:15.851: E/AndroidRuntime(397): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:18:15.851: E/AndroidRuntime(397): ... 19 more
02-02 19:22:23.441: D/AndroidRuntime(453): Shutting down VM
02-02 19:22:23.441: W/dalvikvm(453): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
02-02 19:22:23.471: E/AndroidRuntime(453): FATAL EXCEPTION: main
02-02 19:22:23.471: E/AndroidRuntime(453): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.findyourtaxihere.taxi/com.findyourtaxihere.taxi.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:22:23.471: E/AndroidRuntime(453): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.os.Handler.dispatchMessage(Handler.java:99)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.os.Looper.loop(Looper.java:123)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.app.ActivityThread.main(ActivityThread.java:4627)
02-02 19:22:23.471: E/AndroidRuntime(453): at java.lang.reflect.Method.invokeNative(Native Method)
02-02 19:22:23.471: E/AndroidRuntime(453): at java.lang.reflect.Method.invoke(Method.java:521)
02-02 19:22:23.471: E/AndroidRuntime(453): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
02-02 19:22:23.471: E/AndroidRuntime(453): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
02-02 19:22:23.471: E/AndroidRuntime(453): at dalvik.system.NativeStart.main(Native Method)
02-02 19:22:23.471: E/AndroidRuntime(453): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
02-02 19:22:23.471: E/AndroidRuntime(453): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:576)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
02-02 19:22:23.471: E/AndroidRuntime(453): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.app.Activity.setContentView(Activity.java:1647)
02-02 19:22:23.471: E/AndroidRuntime(453): at com.findyourtaxihere.taxi.MainActivity.onCreate(MainActivity.java:16)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
02-02 19:22:23.471: E/AndroidRuntime(453): ... 11 more
02-02 19:22:23.471: E/AndroidRuntime(453): Caused by: java.lang.ClassNotFoundException: android.view.fragment in loader dalvik.system.PathClassLoader[/data/app/com.findyourtaxihere.taxi-1.apk]
02-02 19:22:23.471: E/AndroidRuntime(453): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
02-02 19:22:23.471: E/AndroidRuntime(453): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
02-02 19:22:23.471: E/AndroidRuntime(453): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.view.LayoutInflater.createView(LayoutInflater.java:466)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:544)
02-02 19:22:23.471: E/AndroidRuntime(453): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-02 19:22:23.471: E/AndroidRuntime(453): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
02-02 19:22:23.471: E/AndroidRuntime(453): ... 19 more
02-02 19:27:23.551: I/Process(453): Sending signal. PID: 453 SIG: 9
You need to set your min SDK to 11 so the code can only be run on devices where Activity knows how to inflate fragment tags.
Or just use the v4 support library and change your activity to extend FragmentActivity.

Getting java.lang.NullPointerException In Android webView

I am working on an application in which i scan a QR code and using that I am opening the pdf related to it.
THIS IS MY CODE
if(uri.contains("abc"))
{
WebView webview= new WebView(getApplicationContext());
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl("http://docs.google.com/gview?embedded=true&url=" + uri);
but my application is crashing and i am getting java.lang.NullPointerException.
Please Help me. every help will be appreciated.
HERE IS MY ERROR LOG
03-15 18:26:03.150: I/Adreno200-EGLSUB(4541): <ConfigWindowMatch:2081>: Format RGBA_8888.
03-15 18:26:03.160: D/memalloc(4541): /dev/pmem: Mapped buffer base:0x519b7000 size:3010560 offset:2396160 fd:66
03-15 18:26:03.610: D/CameraConfigurationManager(4541): Default preview format: 17/yuv420sp
03-15 18:26:03.610: D/CameraConfigurationManager(4541): Screen resolution: Point(480, 320)
03-15 18:26:03.610: D/CameraConfigurationManager(4541): preview-size-values parameter: 640x480,640x368,512x288,384x288,352x288,320x240,176x144
03-15 18:26:03.610: D/CameraConfigurationManager(4541): Camera resolution: Point(512, 288)
03-15 18:26:03.620: D/CameraConfigurationManager(4541): Setting preview size: Point(512, 288)
03-15 18:26:03.780: D/CameraManager(4541): Calculated framing rect: Rect(60, 40 - 420, 280)
03-15 18:26:03.900: D/memalloc(4541): /dev/pmem: Mapped buffer base:0x51f16000 size:6184960 offset:5570560 fd:72
03-15 18:26:04.100: D/memalloc(4541): /dev/pmem: Mapped buffer base:0x525fc000 size:1843200 offset:1228800 fd:75
03-15 18:26:05.140: D/-heap(4541): GC_FOR_ALLOC freed 1322K, 22% free 6798K/8611K, paused 82ms
03-15 18:26:06.340: D/DecodeHandler(4541): Found barcode in 267 ms
03-15 18:26:06.360: D/-heap(4541): GC_FOR_ALLOC freed 1363K, 24% free 6817K/8867K, paused 19ms
03-15 18:26:06.380: D/CaptureActivityHandler(4541): Got decode succeeded message
03-15 18:26:06.530: D/MediaPlayer(4541): start() mUri is null
03-15 18:26:08.510: W/dalvikvm(4541): threadid=1: thread exiting with uncaught exception (group=0x40af39f0)
03-15 18:26:08.520: E/AndroidRuntime(4541): FATAL EXCEPTION: main
03-15 18:26:08.520: E/AndroidRuntime(4541): java.lang.NullPointerException
03-15 18:26:08.520: E/AndroidRuntime(4541): at android.view.ViewConfiguration.get(ViewConfiguration.java:333)
03-15 18:26:08.520: E/AndroidRuntime(4541): at android.view.View.<init>(View.java:2711)
03-15 18:26:08.520: E/AndroidRuntime(4541): at android.view.View.<init>(View.java:2757)
03-15 18:26:08.520: E/AndroidRuntime(4541): at android.view.ViewGroup.<init>(ViewGroup.java:419)
03-15 18:26:08.520: E/AndroidRuntime(4541): at android.widget.AbsoluteLayout.<init>(AbsoluteLayout.java:52)
03-15 18:26:08.520: E/AndroidRuntime(4541): at android.webkit.WebView.<init>(WebView.java:1092)
03-15 18:26:08.520: E/AndroidRuntime(4541): at android.webkit.WebView.<init>(WebView.java:1075)
03-15 18:26:08.520: E/AndroidRuntime(4541): at android.webkit.WebView.<init>(WebView.java:1064)
03-15 18:26:08.520: E/AndroidRuntime(4541): at android.webkit.WebView.<init>(WebView.java:1054)
03-15 18:26:08.520: E/AndroidRuntime(4541): at android.webkit.WebView.<init>(WebView.java:1045)
03-15 18:26:08.520: E/AndroidRuntime(4541): at com.google.zxing.client.android.result.URIResultHandler.handleButtonPress(URIResultHandler.java:146)
03-15 18:26:08.520: E/AndroidRuntime(4541): at com.google.zxing.client.android.result.ResultButtonListener.onClick(ResultButtonListener.java:38)
03-15 18:26:08.520: E/AndroidRuntime(4541): at android.view.View.performClick(View.java:3528)
03-15 18:26:08.520: E/AndroidRuntime(4541): at android.view.View$PerformClick.run(View.java:14235)
03-15 18:26:08.520: E/AndroidRuntime(4541): at android.os.Handler.handleCallback(Handler.java:605)
03-15 18:26:08.520: E/AndroidRuntime(4541): at android.os.Handler.dispatchMessage(Handler.java:92)
03-15 18:26:08.520: E/AndroidRuntime(4541): at android.os.Looper.loop(Looper.java:137)
03-15 18:26:08.520: E/AndroidRuntime(4541): at android.app.ActivityThread.main(ActivityThread.java:4424)
03-15 18:26:08.520: E/AndroidRuntime(4541): at java.lang.reflect.Method.invokeNative(Native Method)
03-15 18:26:08.520: E/AndroidRuntime(4541): at java.lang.reflect.Method.invoke(Method.java:511)
03-15 18:26:08.520: E/AndroidRuntime(4541): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:817)
03-15 18:26:08.520: E/AndroidRuntime(4541): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:584)
03-15 18:26:08.520: E/AndroidRuntime(4541): at dalvik.system.NativeStart.main(Native Method)
Your WebView is flowing in air. Attach it to view hierarchy before doing anything or create webview via xml layout.

Inflate Error on Google Maps v2

I try to add a Google Map to my application and using this tutorial I generated API code, added all necessary meta data, permissions etc. Whenever i click the button to start a new activity the app crashes on my Galaxy S3
onClickListener
Button.setOnClickListener(new OnClickListener() {
#Override
public void onClick(View v) {
if (v == Button) {
startActivity(new Intent(MainActivity.this, ShowMap.class));
}
}
});
Map class
public class ShowMap extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.show_map);
}
}
show_map.xml
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"/>
Error
03-15 20:14:51.825: E/AndroidRuntime(18318): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appname.subappname/com.appname.subappname.ShowMap}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100)
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.app.ActivityThread.access$600(ActivityThread.java:140)
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.os.Handler.dispatchMessage(Handler.java:99)
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.os.Looper.loop(Looper.java:137)
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.app.ActivityThread.main(ActivityThread.java:4898)
03-15 20:14:51.825: E/AndroidRuntime(18318): at java.lang.reflect.Method.invokeNative(Native Method)
03-15 20:14:51.825: E/AndroidRuntime(18318): at java.lang.reflect.Method.invoke(Method.java:511)
03-15 20:14:51.825: E/AndroidRuntime(18318): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
03-15 20:14:51.825: E/AndroidRuntime(18318): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
03-15 20:14:51.825: E/AndroidRuntime(18318): at dalvik.system.NativeStart.main(Native Method)
03-15 20:14:51.825: E/AndroidRuntime(18318): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
03-15 20:14:51.825: E/AndroidRuntime(18318): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:308)
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.app.Activity.setContentView(Activity.java:1924)
03-15 20:14:51.825: E/AndroidRuntime(18318): at com.appname.subappname.ShowMap.onCreate(ShowMap.java:11)
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.app.Activity.performCreate(Activity.java:5206)
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
03-15 20:14:51.825: E/AndroidRuntime(18318): ... 11 more
03-15 20:14:51.825: E/AndroidRuntime(18318): Caused by: java.lang.ClassCastException: com.google.android.gms.maps.MapFragment cannot be cast to android.support.v4.app.Fragment
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.support.v4.app.Fragment.instantiate(Fragment.java:394)
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.support.v4.app.Fragment.instantiate(Fragment.java:369)
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:272)
03-15 20:14:51.825: E/AndroidRuntime(18318): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:676)
03-15 20:14:51.825: E/AndroidRuntime(18318): ... 20 more
The class com.google.android.gms.maps.MapFragment is not found. Check if library google-play-services_lib is properly linked to the project.
your ShowMap should extends FragmentActivity for this to work not Activity , check the examples included in google-play-sevice library for google maps they are a big help.
Edit
make sure you are including google-play-service library project, as the exception is ClassNotFoundException: com.google.android.gms.maps.MapFragment
check this link on how to include the library project

application has stopped unexpectedly

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

OPEN FEINT error in Android App

15 reports
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.oas.fruitkungfufree/com.openfeint.internal.ui.IntroFlow}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
at android.app.ActivityThread.access$2300(ActivityThread.java:125)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:4627)
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:858)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.openfeint.internal.Util.setOrientation(Util.java:36)
at com.openfeint.internal.ui.NestedWindow.onCreate(NestedWindow.java:32)
at com.openfeint.internal.ui.WebNav.onCreate(WebNav.java:93)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
Does any one have a solution for this??
This is a problem with your code, you can't use an object that is null. This is a hint.

Categories

Resources