I'm trying to develop some app with Google Maps API.
I'm followed this tutorial step by step and the app crashed!
I tried so many tutorials, even this one, but I get always the same error:
05-18 00:53:16.466: E/AndroidRuntime(17073): FATAL EXCEPTION: main
05-18 00:53:16.466: E/AndroidRuntime(17073): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.googlemaps/com.example.googlemaps.MainActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2295)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.ActivityThread.access$700(ActivityThread.java:159)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.os.Handler.dispatchMessage(Handler.java:99)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.os.Looper.loop(Looper.java:137)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.ActivityThread.main(ActivityThread.java:5419)
05-18 00:53:16.466: E/AndroidRuntime(17073): at java.lang.reflect.Method.invokeNative(Native Method)
05-18 00:53:16.466: E/AndroidRuntime(17073): at java.lang.reflect.Method.invoke(Method.java:525)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
05-18 00:53:16.466: E/AndroidRuntime(17073): at dalvik.system.NativeStart.main(Native Method)
05-18 00:53:16.466: E/AndroidRuntime(17073): Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class fragment
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:719)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.view.LayoutInflater.rInflate(LayoutInflater.java:761)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.view.LayoutInflater.inflate(LayoutInflater.java:498)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.view.LayoutInflater.inflate(LayoutInflater.java:398)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.view.LayoutInflater.inflate(LayoutInflater.java:354)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:361)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.Activity.setContentView(Activity.java:1956)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.example.googlemaps.MainActivity.onCreate(MainActivity.java:20)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.Activity.performCreate(Activity.java:5372)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257)
05-18 00:53:16.466: E/AndroidRuntime(17073): ... 11 more
05-18 00:53:16.466: E/AndroidRuntime(17073): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 4132500 but found 0. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.common.GooglePlayServicesUtil.n(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.maps.internal.q.v(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.maps.internal.q.u(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.maps.MapFragment$b.eb(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.maps.MapFragment$b.a(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.dynamic.a.a(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.dynamic.a.onInflate(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.app.Activity.onCreateView(Activity.java:4965)
05-18 00:53:16.466: E/AndroidRuntime(17073): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:695)
05-18 00:53:16.466: E/AndroidRuntime(17073): ... 21 more
Can someone help?
Replace #integer/google_play_services_version with 4132500
see this
google-play-services_lib --> res --> values --> version.xml
for the correct version of your google play services
Related
05-18 19:05:06.591: E/AndroidRuntime(23525): FATAL EXCEPTION: main
05-18 19:05:06.591: E/AndroidRuntime(23525): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.fbtest/com.example.fbtest.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class com.facebook.login.widget.LoginButton
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2372)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2424)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.access$600(ActivityThread.java:169)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1388)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.os.Handler.dispatchMessage(Handler.java:107)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.os.Looper.loop(Looper.java:194)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.main(ActivityThread.java:5433)
05-18 19:05:06.591: E/AndroidRuntime(23525): at java.lang.reflect.Method.invokeNative(Native Method)
05-18 19:05:06.591: E/AndroidRuntime(23525): at java.lang.reflect.Method.invoke(Method.java:525)
05-18 19:05:06.591: E/AndroidRuntime(23525): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:924)
05-18 19:05:06.591: E/AndroidRuntime(23525): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:691)
05-18 19:05:06.591: E/AndroidRuntime(23525): at dalvik.system.NativeStart.main(Native Method)
05-18 19:05:06.591: E/AndroidRuntime(23525): Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class com.facebook.login.widget.LoginButton
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
05-18 19:05:06.591: E/AndroidRuntime(23525): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:274)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.Activity.setContentView(Activity.java:1895)
05-18 19:05:06.591: E/AndroidRuntime(23525): at com.example.fbtest.MainActivity.onCreate(MainActivity.java:23)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.Activity.performCreate(Activity.java:5179)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2336)
05-18 19:05:06.591: E/AndroidRuntime(23525): ... 11 more
05-18 19:05:06.591: E/AndroidRuntime(23525): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.login.widget.LoginButton" on path: DexPathList[[zip file "/data/app/com.example.fbtest-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.fbtest-2, /vendor/lib, /system/lib, /data/datalib]]
05-18 19:05:06.591: E/AndroidRuntime(23525): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
05-18 19:05:06.591: E/AndroidRuntime(23525): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
05-18 19:05:06.591: E/AndroidRuntime(23525): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.createView(LayoutInflater.java:552)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
05-18 19:05:06.591: E/AndroidRuntime(23525): ... 21 more
Have you import sdk library into eclipse,have you mark project As Library, and import that to your project?
This is my error after I run App. After importing Facebook 4.1.2 project it says that I need Java 1.7, android support v4 and Bolts-Android so I updated my Android tools library from last version and it's showing an error.
05-18 19:05:06.591: E/AndroidRuntime(23525): FATAL EXCEPTION: main
05-18 19:05:06.591: E/AndroidRuntime(23525): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.fbtest/com.example.fbtest.MainActivity}: android.view.InflateException: Binary XML file line #11: Error inflating class com.facebook.login.widget.LoginButton
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2372)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2424)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.access$600(ActivityThread.java:169)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1388)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.os.Handler.dispatchMessage(Handler.java:107)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.os.Looper.loop(Looper.java:194)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.main(ActivityThread.java:5433)
05-18 19:05:06.591: E/AndroidRuntime(23525): at java.lang.reflect.Method.invokeNative(Native Method)
05-18 19:05:06.591: E/AndroidRuntime(23525): at java.lang.reflect.Method.invoke(Method.java:525)
05-18 19:05:06.591: E/AndroidRuntime(23525): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:924)
05-18 19:05:06.591: E/AndroidRuntime(23525): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:691)
05-18 19:05:06.591: E/AndroidRuntime(23525): at dalvik.system.NativeStart.main(Native Method)
05-18 19:05:06.591: E/AndroidRuntime(23525): Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class com.facebook.login.widget.LoginButton
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
05-18 19:05:06.591: E/AndroidRuntime(23525): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:274)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.Activity.setContentView(Activity.java:1895)
05-18 19:05:06.591: E/AndroidRuntime(23525): at com.example.fbtest.MainActivity.onCreate(MainActivity.java:23)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.Activity.performCreate(Activity.java:5179)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1146)
05-18 19:05:06.591: E/AndroidRuntime(23525): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2336)
05-18 19:05:06.591: E/AndroidRuntime(23525): ... 11 more
05-18 19:05:06.591: E/AndroidRuntime(23525): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.login.widget.LoginButton" on path: DexPathList[[zip file "/data/app/com.example.fbtest-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.fbtest-2, /vendor/lib, /system/lib, /data/datalib]]
05-18 19:05:06.591: E/AndroidRuntime(23525): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
05-18 19:05:06.591: E/AndroidRuntime(23525): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
05-18 19:05:06.591: E/AndroidRuntime(23525): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
Images for xml and manifest are:
XML,MANIFEST
To remove this error, first place your Facebook SDK in your workspace and then import in eclipse.
I tried alot added all libraries with no use and followed documentation to make it work any help would be appreciated
Here's what appear at my logcat:
05-18 17:26:50.480: E/dalvikvm(5818): Could not find class 'com.google.maps.android.utils.demo.ClusteringDemoActivity', referenced from method com.google.maps.android.utils.demo.MainActivity.onCreate
05-18 17:26:50.552: E/AndroidRuntime(5818): FATAL EXCEPTION: main
05-18 17:26:50.552: E/AndroidRuntime(5818): java.lang.NoClassDefFoundError: com.google.maps.android.utils.demo.ClusteringDemoActivity
05-18 17:26:50.552: E/AndroidRuntime(5818): at com.google.maps.android.utils.demo.MainActivity.onCreate(MainActivity.java:22)
05-18 17:26:50.552: E/AndroidRuntime(5818): at android.app.Activity.performCreate(Activity.java:5133)
05-18 17:26:50.552: E/AndroidRuntime(5818): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
05-18 17:26:50.552: E/AndroidRuntime(5818): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2175)
05-18 17:26:50.552: E/AndroidRuntime(5818): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
05-18 17:26:50.552: E/AndroidRuntime(5818): at android.app.ActivityThread.access$600(ActivityThread.java:141)
05-18 17:26:50.552: E/AndroidRuntime(5818): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
05-18 17:26:50.552: E/AndroidRuntime(5818): at android.os.Handler.dispatchMessage(Handler.java:99)
05-18 17:26:50.552: E/AndroidRuntime(5818): at android.os.Looper.loop(Looper.java:137)
05-18 17:26:50.552: E/AndroidRuntime(5818): at android.app.ActivityThread.main(ActivityThread.java:5103)
05-18 17:26:50.552: E/AndroidRuntime(5818): at java.lang.reflect.Method.invokeNative(Native Method)
05-18 17:26:50.552: E/AndroidRuntime(5818): at java.lang.reflect.Method.invoke(Method.java:525)
05-18 17:26:50.552: E/AndroidRuntime(5818): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
05-18 17:26:50.552: E/AndroidRuntime(5818): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
05-18 17:26:50.552: E/AndroidRuntime(5818): at dalvik.system.NativeStart.main(Native Method)
If the app runs visible,everything gets fine.But if I press home to let the app in the background and do some other things, it would get a crash like this:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.qdn.bus/com.qdn.activity.MainActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2001)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2028)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1179)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4508)
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:809)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at android.view.View.onRestoreInstanceState(View.java:9999)
at android.support.v4.view.ViewPager.onRestoreInstanceState(Unknown Source)
at android.view.View.dispatchRestoreInstanceState(View.java:9975)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2397)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2408)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2408)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2408)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2408)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2408)
at android.view.View.restoreHierarchyState(View.java:9951)
at android.support.v4.app.Fragment.restoreViewState(Unknown Source)
at android.support.v4.app.FragmentManagerImpl.moveToState(Unknown Source)
at android.support.v4.app.FragmentManagerImpl.moveToState(Unknown Source)
at android.support.v4.app.FragmentManagerImpl.moveToState(Unknown Source)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(Unknown Source)
at android.support.v4.app.FragmentActivity.onStart(Unknown Source)
at com.qdn.activity.MainActivity.onStart(Unknown Source)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1136)
at com.lbe.security.service.core.client.b.x.callActivityOnStart(Unknown Source)
at android.app.Activity.performStart(Activity.java:4489)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
... 11 more
java.lang.NullPointerException
at android.view.View.onRestoreInstanceState(View.java:9999)
at android.support.v4.view.ViewPager.onRestoreInstanceState(Unknown Source)
at android.view.View.dispatchRestoreInstanceState(View.java:9975)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2397)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2408)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2408)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2408)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2408)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:2408)
at android.view.View.restoreHierarchyState(View.java:9951)
at android.support.v4.app.Fragment.restoreViewState(Unknown Source)
at android.support.v4.app.FragmentManagerImpl.moveToState(Unknown Source)
at android.support.v4.app.FragmentManagerImpl.moveToState(Unknown Source)
at android.support.v4.app.FragmentManagerImpl.moveToState(Unknown Source)
at android.support.v4.app.FragmentManagerImpl.dispatchActivityCreated(Unknown Source)
at android.support.v4.app.FragmentActivity.onStart(Unknown Source)
at com.qdn.activity.MainActivity.onStart(Unknown Source)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1136)
at com.lbe.security.service.core.client.b.x.callActivityOnStart(Unknown Source)
at android.app.Activity.performStart(Activity.java:4489)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2028)
at android.app.ActivityThread.access$600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1179)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4508)
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:809)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:576)
at dalvik.system.NativeStart.main(Native Method)
I think it is because the Delvik Vm has recycle some of the memory.But is there anyway to fix it?
selectQType a simple spinner. The values are getting populated from the DB and they are fine.
ArrayAdapter<String> spinnerArrayAdapter1 =
new ArrayAdapter<String>(SpotlighterBasicActivity.this,
android.R.layout.simple_spinner_item, spinnerQTypeList);
spinnerArrayAdapter1.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item);
Spinner selectQType=(Spinner) findViewById(R.id.spinnerInputQType);
selectQType.setPrompt("QType");// logcat points warning on this line.
selectQType.setAdapter(spinnerArrayAdapter1);
selectQType.setSelection(QTypeIndex);
selectQType.setOnItemSelectedListener(new OnItemSelectedListener() {
...
}
This is the output i get for Tablet:
Strange part is that it is working perfectly fine for mobile category of emulators and devices, but giving warning for tablet category of emulators and devices.
Following is the logcat detail:
05-18 16:47:29.284: E/SpotlighterBasicActivity(481): QTypeIndex=0
05-18 16:47:29.284: E/SpotlighterBasicActivity(481): spinnerArrayList[1]=Type 1, spinnerQTypeID=5853, defaultQType=6307
05-18 16:47:29.294: E/SpotlighterBasicActivity(481): spinnerArrayList[2]=Type 2, spinnerQTypeID=6308, defaultQType=6307
05-18 16:47:29.304: W/System.err(481): java.lang.NullPointerException
05-18 16:47:29.304: W/System.err(481): at in.varit.spotlighter.basic.SpotlighterBasicActivity.loadQTypeSpinners(SpotlighterBasicActivity.java:334)
05-18 16:47:29.304: W/System.err(481): at in.varit.spotlighter.basic.SpotlighterBasicActivity.onCreate(SpotlighterBasicActivity.java:203)
05-18 16:47:29.304: W/System.err(481): at android.app.Activity.performCreate(Activity.java:4397)
05-18 16:47:29.304: W/System.err(481): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
05-18 16:47:29.313: W/System.err(481): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1779)
05-18 16:47:29.313: W/System.err(481): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1831)
05-18 16:47:29.313: W/System.err(481): at android.app.ActivityThread.access$500(ActivityThread.java:122)
05-18 16:47:29.313: W/System.err(481): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1024)
05-18 16:47:29.325: W/System.err(481): at android.os.Handler.dispatchMessage(Handler.java:99)
05-18 16:47:29.325: W/System.err(481): at android.os.Looper.loop(Looper.java:132)
05-18 16:47:29.325: W/System.err(481): at android.app.ActivityThread.main(ActivityThread.java:4123)
05-18 16:47:29.325: W/System.err(481): at java.lang.reflect.Method.invokeNative(Native Method)
05-18 16:47:29.325: W/System.err(481): at java.lang.reflect.Method.invoke(Method.java:491)
05-18 16:47:29.334: W/System.err(481): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
05-18 16:47:29.334: W/System.err(481): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
05-18 16:47:29.334: W/System.err(481): at dalvik.system.NativeStart.main(Native Method)
selectQType is null And
check using if(null!=selectQType)
and also check id of selectQType is it right from layout.xml?