this is my log file
04-01 17:21:32.460: E/dalvikvm(296): Could not find class 'android.app.Notification$Builder', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza
04-01 17:21:32.470: E/dalvikvm(296): Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza
04-01 17:21:32.651: E/AndroidRuntime(296): FATAL EXCEPTION: main
04-01 17:21:32.651: E/AndroidRuntime(296): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tutos.android.gmapv2/com.tutos.android.gmapv2.MyMapActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
04-01 17:21:32.651: E/AndroidRuntime(296): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
04-01 17:21:32.651: E/AndroidRuntime(296): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
04-01 17:21:32.651: E/AndroidRuntime(296): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
04-01 17:21:32.651: E/AndroidRuntime(296): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
04-01 17:21:32.651: E/AndroidRuntime(296): at android.os.Handler.dispatchMessage(Handler.java:99)
04-01 17:21:32.651: E/AndroidRuntime(296): at android.os.Looper.loop(Looper.java:123)
04-01 17:21:32.651: E/AndroidRuntime(296): at android.app.ActivityThread.main(ActivityThread.java:4627)
04-01 17:21:32.651: E/AndroidRuntime(296): at java.lang.reflect.Method.invokeNative(Native Method)
04-01 17:21:32.651: E/AndroidRuntime(296): at java.lang.reflect.Method.invoke(Method.java:521)
04-01 17:21:32.651: E/AndroidRuntime(296): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-01 17:21:32.651: E/AndroidRuntime(296): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-01 17:21:32.651: E/AndroidRuntime(296): at dalvik.system.NativeStart.main(Native Method)
04-01 17:21:32.651: E/AndroidRuntime(296): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
04-01 17:21:32.651: E/AndroidRuntime(296): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:582)
04-01 17:21:32.651: E/AndroidRuntime(296): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
04-01 17:21:32.651: E/AndroidRuntime(296): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
04-01 17:21:32.651: E/AndroidRuntime(296): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
04-01 17:21:32.651: E/AndroidRuntime(296): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
04-01 17:21:32.651: E/AndroidRuntime(296): at android.app.Activity.setContentView(Activity.java:1647)
04-01 17:21:32.651: E/AndroidRuntime(296): at com.tutos.android.gmapv2.MyMapActivity.onCreate(MyMapActivity.java:19)
04-01 17:21:32.651: E/AndroidRuntime(296): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-01 17:21:32.651: E/AndroidRuntime(296): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
04-01 17:21:32.651: E/AndroidRuntime(296): ... 11 more
04-01 17:21:32.651: E/AndroidRuntime(296): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 7095000 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" />
04-01 17:21:32.651: E/AndroidRuntime(296): at com.google.android.gms.common.GooglePlayServicesUtil.zzJ(Unknown Source)
04-01 17:21:32.651: E/AndroidRuntime(296): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
04-01 17:21:32.651: E/AndroidRuntime(296): at com.google.android.gms.maps.internal.zzx.zzad(Unknown Source)
04-01 17:21:32.651: E/AndroidRuntime(296): at com.google.android.gms.maps.internal.zzx.zzac(Unknown Source)
04-01 17:21:32.651: E/AndroidRuntime(296): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
04-01 17:21:32.651: E/AndroidRuntime(296): at com.google.android.gms.maps.SupportMapFragment$zzb.zzqs(Unknown Source)
04-01 17:21:32.651: E/AndroidRuntime(296): at com.google.android.gms.maps.SupportMapFragment$zzb.zza(Unknown Source)
04-01 17:21:32.651: E/AndroidRuntime(296): at com.google.android.gms.dynamic.zza.zza(Unknown Source)
04-01 17:21:32.651: E/AndroidRuntime(296): at com.google.android.gms.dynamic.zza.onInflate(Unknown Source)
04-01 17:21:32.651: E/AndroidRuntime(296): at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
04-01 17:21:32.651: E/AndroidRuntime(296): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279)
04-01 17:21:32.651: E/AndroidRuntime(296): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:558)
04-01 17:21:32.651: E/AndroidRuntime(296): ... 19 more
04-01 17:25:30.440: E/dalvikvm(305): Could not find class 'android.app.Notification$Builder', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza
04-01 17:25:30.460: E/dalvikvm(305): Could not find class 'android.app.AppOpsManager', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.zza
04-01 17:25:30.530: E/AndroidRuntime(305): FATAL EXCEPTION: main
04-01 17:25:30.530: E/AndroidRuntime(305): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tutos.android.gmapv2/com.tutos.android.gmapv2.MyMapActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
04-01 17:25:30.530: E/AndroidRuntime(305): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
04-01 17:25:30.530: E/AndroidRuntime(305): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
04-01 17:25:30.530: E/AndroidRuntime(305): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
04-01 17:25:30.530: E/AndroidRuntime(305): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
04-01 17:25:30.530: E/AndroidRuntime(305): at android.os.Handler.dispatchMessage(Handler.java:99)
04-01 17:25:30.530: E/AndroidRuntime(305): at android.os.Looper.loop(Looper.java:123)
04-01 17:25:30.530: E/AndroidRuntime(305): at android.app.ActivityThread.main(ActivityThread.java:4627)
04-01 17:25:30.530: E/AndroidRuntime(305): at java.lang.reflect.Method.invokeNative(Native Method)
04-01 17:25:30.530: E/AndroidRuntime(305): at java.lang.reflect.Method.invoke(Method.java:521)
04-01 17:25:30.530: E/AndroidRuntime(305): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-01 17:25:30.530: E/AndroidRuntime(305): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
04-01 17:25:30.530: E/AndroidRuntime(305): at dalvik.system.NativeStart.main(Native Method)
04-01 17:25:30.530: E/AndroidRuntime(305): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class fragment
04-01 17:25:30.530: E/AndroidRuntime(305): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:582)
04-01 17:25:30.530: E/AndroidRuntime(305): at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
04-01 17:25:30.530: E/AndroidRuntime(305): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
04-01 17:25:30.530: E/AndroidRuntime(305): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
04-01 17:25:30.530: E/AndroidRuntime(305): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
04-01 17:25:30.530: E/AndroidRuntime(305): at android.app.Activity.setContentView(Activity.java:1647)
04-01 17:25:30.530: E/AndroidRuntime(305): at com.tutos.android.gmapv2.MyMapActivity.onCreate(MyMapActivity.java:19)
04-01 17:25:30.530: E/AndroidRuntime(305): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-01 17:25:30.530: E/AndroidRuntime(305): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
04-01 17:25:30.530: E/AndroidRuntime(305): ... 11 more
04-01 17:25:30.530: E/AndroidRuntime(305): Caused by: java.lang.IllegalStateException: The meta-data tag in your app's AndroidManifest.xml does not have the right value. Expected 7095000 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" />
04-01 17:25:30.530: E/AndroidRuntime(305): at com.google.android.gms.common.GooglePlayServicesUtil.zzJ(Unknown Source)
04-01 17:25:30.530: E/AndroidRuntime(305): at com.google.android.gms.common.GooglePlayServicesUtil.isGooglePlayServicesAvailable(Unknown Source)
04-01 17:25:30.530: E/AndroidRuntime(305): at com.google.android.gms.maps.internal.zzx.zzad(Unknown Source)
04-01 17:25:30.530: E/AndroidRuntime(305): at com.google.android.gms.maps.internal.zzx.zzac(Unknown Source)
04-01 17:25:30.530: E/AndroidRuntime(305): at com.google.android.gms.maps.MapsInitializer.initialize(Unknown Source)
04-01 17:25:30.530: E/AndroidRuntime(305): at com.google.android.gms.maps.SupportMapFragment$zzb.zzqs(Unknown Source)
04-01 17:25:30.530: E/AndroidRuntime(305): at com.google.android.gms.maps.SupportMapFragment$zzb.zza(Unknown Source)
04-01 17:25:30.530: E/AndroidRuntime(305): at com.google.android.gms.dynamic.zza.zza(Unknown Source)
04-01 17:25:30.530: E/AndroidRuntime(305): at com.google.android.gms.dynamic.zza.onInflate(Unknown Source)
04-01 17:25:30.530: E/AndroidRuntime(305): at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
04-01 17:25:30.530: E/AndroidRuntime(305): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279)
04-01 17:25:30.530: E/AndroidRuntime(305): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:558)
04-01 17:25:30.530: E/AndroidRuntime(305): ... 19 more
Your manifest.xml file is missing the below line, just add it and it should fix your problem.
Edit your application's AndroidManifest.xml file, and add the following declaration within the element. This embeds the version of Google Play services that the app was compiled with.
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
Android developers guide for more details https://developers.google.com/maps/documentation/android/start
Related
There isn't a default audio recorder on the Nexus 5, so calling navigator.device.capture.captureAudio results in:
04-01 14:48:08.562 W/System.err(24130): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.provider.MediaStore.RECORD_SOUND }
04-01 14:48:08.562 W/System.err(24130): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1632)
04-01 14:48:08.562 W/System.err(24130): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1424)
04-01 14:48:08.562 W/System.err(24130): at android.app.Activity.startActivityForResult(Activity.java:3424)
04-01 14:48:08.562 W/System.err(24130): at android.app.Activity.startActivityForResult(Activity.java:3385)
04-01 14:48:08.562 W/System.err(24130): at org.apache.cordova.CordovaActivity.startActivityForResult(CordovaActivity.java:901)
04-01 14:48:08.562 D/CordovaActivity(24130): Paused the application!
04-01 14:48:08.562 D/CordovaWebView(24130): Handle the pause
04-01 14:48:08.562 W/System.err(24130): at org.apache.cordova.mediacapture.Capture.captureAudio(Capture.java:198)
04-01 14:48:08.562 W/System.err(24130): at org.apache.cordova.mediacapture.Capture.execute(Capture.java:99)
04-01 14:48:08.562 W/System.err(24130): at org.apache.cordova.CordovaPlugin.execute(CordovaPlugin.java:65)
04-01 14:48:08.562 W/System.err(24130): at org.apache.cordova.PluginManager.execHelper(PluginManager.java:242)
04-01 14:48:08.562 W/System.err(24130): at org.apache.cordova.PluginManager.exec(PluginManager.java:227)
04-01 14:48:08.562 W/System.err(24130): at org.apache.cordova.ExposedJsApi.exec(ExposedJsApi.java:53)
04-01 14:48:08.562 W/System.err(24130): at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
04-01 14:48:08.562 W/System.err(24130): at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
04-01 14:48:08.562 W/System.err(24130): at android.os.Handler.dispatchMessage(Handler.java:102)
04-01 14:48:08.562 W/System.err(24130): at android.os.Looper.loop(Looper.java:136)
What are the options for getting an audio recorder working on cordova/phonegap applications for the Nexus 5?
I think you're down to two options:
Capture the error, and prompt user to install a recorder app from app store. This might not be easy though; https://issues.apache.org/jira/browse/CB-5603 says that cordova does the callback with CaptureError.CAPTURE_NO_MEDIA_FILES so it might not be possible to distinguish this error from user returning from recorder without actually recording anything.
Modify cordova framework to provide a fallback Activity that can handle the recording, similar to what is already provided for iOS and WP7/8.
I have created a Phone & Tablet app for android and have the generic layout folder populated with the layouts, I then created two additional folders in the res directory with the suffix -sw600dp & -sw720dp and it is not working and the app is crashing every time no matter what I try. Can someone please give me some other options.
Log Cat Error:
04-01 02:34:23.567: E/AndroidRuntime(898): FATAL EXCEPTION: main
04-01 02:34:23.567: E/AndroidRuntime(898): java.lang.NullPointerException
04-01 02:34:23.567: E/AndroidRuntime(898): at za.co.astroweb.watsonline.wats_online_fragment$getBlogPosts.onPostExecute(wats_online_fragment.java:173)
04-01 02:34:23.567: E/AndroidRuntime(898): at za.co.astroweb.watsonline.wats_online_fragment$getBlogPosts.onPostExecute(wats_online_fragment.java:1)
04-01 02:34:23.567: E/AndroidRuntime(898): at android.os.AsyncTask.finish(AsyncTask.java:631)
04-01 02:34:23.567: E/AndroidRuntime(898): at android.os.AsyncTask.access$600(AsyncTask.java:177)
04-01 02:34:23.567: E/AndroidRuntime(898): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:644)
04-01 02:34:23.567: E/AndroidRuntime(898): at android.os.Handler.dispatchMessage(Handler.java:99)
04-01 02:34:23.567: E/AndroidRuntime(898): at android.os.Looper.loop(Looper.java:137)
04-01 02:34:23.567: E/AndroidRuntime(898): at android.app.ActivityThread.main(ActivityThread.java:5103)
04-01 02:34:23.567: E/AndroidRuntime(898): at java.lang.reflect.Method.invokeNative(Native Method)
04-01 02:34:23.567: E/AndroidRuntime(898): at java.lang.reflect.Method.invoke(Method.java:525)
04-01 02:34:23.567: E/AndroidRuntime(898): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
04-01 02:34:23.567: E/AndroidRuntime(898): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
04-01 02:34:23.567: E/AndroidRuntime(898): at dalvik.system.NativeStart.main(Native Method)
I Have Tried Below tutorial For Reading Contacts In Android
http://www.edumobile.org/android/android-programming-tutorials/read-contacts-from-device/
http://eagle.phys.utk.edu/guidry/android/readContacts.html
Both Are Complete without any Error But When I Am Running It's Showing Force Close Error
I tried with API 8,13,16
Same Error For all. I Dont Know More About It But I Completly Follow Tutorial.
Catlog Here
09-30 14:02:09.121: D/AndroidRuntime(305): Shutting down VM
09-30 14:02:09.121: W/dalvikvm(305): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
09-30 14:02:09.141: E/AndroidRuntime(305): FATAL EXCEPTION: main
09-30 14:02:09.141: E/AndroidRuntime(305): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.app.ReadContacts/com.app.ReadContacts.ReadContacts}: java.lang.ClassNotFoundException: com.app.ReadContacts.ReadContacts in loader dalvik.system.PathClassLoader[/data/app/com.app.ReadContacts-2.apk]
09-30 14:02:09.141: E/AndroidRuntime(305): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
09-30 14:02:09.141: E/AndroidRuntime(305): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
09-30 14:02:09.141: E/AndroidRuntime(305): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
09-30 14:02:09.141: E/AndroidRuntime(305): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
09-30 14:02:09.141: E/AndroidRuntime(305): at android.os.Handler.dispatchMessage(Handler.java:99)
09-30 14:02:09.141: E/AndroidRuntime(305): at android.os.Looper.loop(Looper.java:123)
09-30 14:02:09.141: E/AndroidRuntime(305): at android.app.ActivityThread.main(ActivityThread.java:4627)
09-30 14:02:09.141: E/AndroidRuntime(305): at java.lang.reflect.Method.invokeNative(Native Method)
09-30 14:02:09.141: E/AndroidRuntime(305): at java.lang.reflect.Method.invoke(Method.java:521)
09-30 14:02:09.141: E/AndroidRuntime(305): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
09-30 14:02:09.141: E/AndroidRuntime(305): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
09-30 14:02:09.141: E/AndroidRuntime(305): at dalvik.system.NativeStart.main(Native Method)
09-30 14:02:09.141: E/AndroidRuntime(305): Caused by: java.lang.ClassNotFoundException: com.app.ReadContacts.ReadContacts in loader dalvik.system.PathClassLoader[/data/app/com.app.ReadContacts-2.apk]
09-30 14:02:09.141: E/AndroidRuntime(305): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
09-30 14:02:09.141: E/AndroidRuntime(305): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
09-30 14:02:09.141: E/AndroidRuntime(305): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
09-30 14:02:09.141: E/AndroidRuntime(305): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
09-30 14:02:09.141: E/AndroidRuntime(305): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
09-30 14:02:09.141: E/AndroidRuntime(305): ... 11 more
09-30 14:07:09.262: I/Process(305): Sending signal. PID: 305 SIG: 9
Have you added the com.app.ReadContacts.ReadContacts Activity to your AndroidManifest.xml?
The error you're receiving suggests that you haven't...
The line to add is probably
<activity android:name=".ReadContacts"/>
although depending on your project structure it can be necessary to use the fully qualified name
<activity android:name="com.app.ReadContacts.ReadContacts"/>
have u mentioned read contacts permission in manifest file?
<uses-permission android:name="android.permission.READ_CONTACTS" />
if yes, post the error message from log cat
It appears that the class com.app.ReadContacts.ReadContacts cannot be found. Have you specified your Activity in your AndroidManifest.xml file?
i got following strange exception on only andorid simulator 2.0
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.markupartist.android.example.pulltorefresh/com.markupartist.android.example.pulltorefresh.PullToRefreshActivity}: android.view.InflateException: Binary XML file line #10: Error inflating class com.markupartist.android.widget.PullToRefreshListView
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:868)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class com.markupartist.android.widget.PullToRefreshListView
at android.view.LayoutInflater.createView(LayoutInflater.java:513)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
at android.app.Activity.setContentView(Activity.java:1647)
at com.markupartist.android.example.pulltorefresh.PullToRefreshActivity.onCreate(PullToRefresh Activity.java:21)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
... 11 more
Caused by: java.lang.reflect.InvocationTargetException
at com.markupartist.android.widget.PullToRefreshListView. (PullToRefreshListView.java:54)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
at android.view.LayoutInflater.createView(LayoutInflater.java:500)
... 21 more
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f030002
at android.content.res.Resources.getValue(Resources.java:892)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:1869)
at android.content.res.Resources.getLayout(Resources.java:731)
at android.view.LayoutInflater.inflate(LayoutInflater.java:318)
at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
at com.markupartist.android.widget.PullToRefreshListView.init(PullToRefreshListView.java:80)
... 25 more
when i tested on andorid 1.6 , 2.01,2.1,2.2,2.3 ,4.0 it works completely,
is this a simulator bug of 2.0
please give me some information about this
Thanks
I'm confused at how to make adview from admob work with a listview. I'm new to ads and have just finished the basic tutorial but now trying to put in in my own app. I have some things commented out that I tried to do to begin with.
// Create the adView
AdView adView = new AdView(this, AdSize.BANNER, myID);
// Lookup your LinearLayout assuming it’s been given
// the attribute android:id="#+id/mainLayout"
// LinearLayout layout = (LinearLayout)findViewById(R.id.linearLayout);
// Add the adView to it
lv.addView(adView);
// Initiate a generic request to load it with an ad
adView.loadAd(new AdRequest());
<TextView android:id="#+id/itemName" android:layout_width="wrap_content"
android:layout_height="50dip" android:text="Test view"
android:textSize = "25sp"
android:singleLine = "true"/>
04-01 19:28:58.163: ERROR/AndroidRuntime(421): FATAL EXCEPTION: main
04-01 19:28:58.163: ERROR/AndroidRuntime(421):
java.lang.RuntimeException: Unable to start activity
ComponentInfo{org.demo.textaway2/org.demo.textaway2.TextAway2}:
java.lang.UnsupportedOperationException: addView(View) is not
supported in AdapterView 04-01 19:28:58.163:
ERROR/AndroidRuntime(421): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
04-01 19:28:58.163: ERROR/AndroidRuntime(421): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
04-01 19:28:58.163: ERROR/AndroidRuntime(421): at
android.app.ActivityThread.access$2300(ActivityThread.java:125) 04-01
19:28:58.163: ERROR/AndroidRuntime(421): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
04-01 19:28:58.163: ERROR/AndroidRuntime(421): at
android.os.Handler.dispatchMessage(Handler.java:99) 04-01
19:28:58.163: ERROR/AndroidRuntime(421): at
android.os.Looper.loop(Looper.java:123) 04-01 19:28:58.163:
ERROR/AndroidRuntime(421): at
android.app.ActivityThread.main(ActivityThread.java:4627) 04-01
19:28:58.163: ERROR/AndroidRuntime(421): at
java.lang.reflect.Method.invokeNative(Native Method) 04-01
19:28:58.163: ERROR/AndroidRuntime(421): at
java.lang.reflect.Method.invoke(Method.java:521) 04-01 19:28:58.163:
ERROR/AndroidRuntime(421): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
04-01 19:28:58.163: ERROR/AndroidRuntime(421): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 04-01
19:28:58.163: ERROR/AndroidRuntime(421): at
dalvik.system.NativeStart.main(Native Method) 04-01 19:28:58.163:
ERROR/AndroidRuntime(421): Caused by:
java.lang.UnsupportedOperationException: addView(View) is not
supported in AdapterView 04-01 19:28:58.163:
ERROR/AndroidRuntime(421): at
android.widget.AdapterView.addView(AdapterView.java:435) 04-01
19:28:58.163: ERROR/AndroidRuntime(421): at
org.demo.textaway2.TextAway2.onCreate(TextAway2.java:164) 04-01
19:28:58.163: ERROR/AndroidRuntime(421): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
04-01 19:28:58.163: ERROR/AndroidRuntime(421): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
04-01 19:28:58.163: ERROR/AndroidRuntime(421): ... 11 more
The stack trace includes this:
addView(View) is not supported in AdapterView
Which answers your question - you can't use AdMob in an AdapterView or its subclasses, which you're trying to do. You'll either need to write your own View class to render the list objects, use a different ad service (adwhirl etc - perhaps another doesn't have this limitation) or move the ad(s) outside the list, into a footer/header.