Eclipse android LogCat: GCMRegistrar: saving regId on app error - android

I can not figure this out, in one of my test apps I get an error when closing the app.
In LogCat I see the handleRegistration long code as ok, in blue text but some lines futher after saving regId on app the registration code is in red text.
Someone know why?
In another app, at the same emulator, it does not happen but I can not find the solution.
EDIT
You are right, sorry, this is LogCat output:
10-26 12:22:11.383: I/dalvikvm(754): threadid=3: reacting to signal 3
10-26 12:22:11.539: I/dalvikvm(754): Wrote stack traces to '/data/anr/traces.txt'
10-26 12:22:11.644: I/dalvikvm(754): threadid=3: reacting to signal 3
10-26 12:22:11.718: I/dalvikvm(754): Wrote stack traces to '/data/anr/traces.txt'
10-26 12:22:11.873: D/GCMRegistrar(754): resetting backoff for nl.easy.gcmnotification
10-26 12:22:11.883: V/GCMRegistrar(754): Registering app nl.easy.gcmnotification of senders 182xxxxxx601
10-26 12:22:12.153: I/dalvikvm(754): threadid=3: reacting to signal 3
10-26 12:22:12.163: I/dalvikvm(754): Wrote stack traces to '/data/anr/traces.txt'
10-26 12:22:12.445: D/gralloc_goldfish(754): Emulator without GPU emulation detected.
10-26 12:22:13.843: V/GCMBroadcastReceiver(754): onReceive:
com.google.android.c2dm.intent.REGISTRATION
10-26 12:22:13.843: V/GCMBroadcastReceiver(754): GCM IntentService class: nl.easy.gcmnotification.GCMIntentService
10-26 12:22:13.853: V/GCMBaseIntentService(754): Acquiring wakelock
10-26 12:22:13.864: V/GCMBaseIntentService(754): Intent service name: GCMIntentService-182537982601-1
10-26 12:22:13.953: E/GCMRegistrar(754): internal error: retry receiver class not set yet
10-26 12:22:13.953: V/GCMRegistrar(754): Registering receiver
10-26 12:22:13.953: D/GCMBaseIntentService(754): handleRegistration: registrationId = APAxxxxxx8Kg, error = null, unregistered = null (IN COLOR BLUE)
10-26 12:22:13.953: D/GCMRegistrar(754): resetting backoff for nl.easy.gcmnotification
10-26 12:22:13.964: V/GCMRegistrar(754): Saving regId on app version 1
10-26 12:22:13.973: E/(754): registration id : APAxxxxxx8Kg (IN COLOR RED)
10-26 12:22:13.973: V/GCMBaseIntentService(754): Releasing wakelock
(WHEN SHUTTING DOWN APP)
10-26 12:22:35.033: V/GCMRegistrar(754): Unregistering receiver
10-26 12:22:35.033: D/AndroidRuntime(754): Shutting down VM
10-26 12:22:35.033: W/dalvikvm(754): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
10-26 12:22:35.155: E/AndroidRuntime(754): FATAL EXCEPTION: main
10-26 12:22:35.155: E/AndroidRuntime(754): java.lang.RuntimeException: Unable to destroy activity {nl.easy.gcmnotification/nl.easy.gcmnotification.MainActivity}: java.lang.IllegalArgumentException: Receiver not registered: com.google.android.gcm.GCMBroadcastReceiver#412bc5c0
10-26 12:22:35.155: E/AndroidRuntime(754): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3112)
10-26 12:22:35.155: E/AndroidRuntime(754): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3130)
10-26 12:22:35.155: E/AndroidRuntime(754): at android.app.ActivityThread.access$1200(ActivityThread.java:123)
10-26 12:22:35.155: E/AndroidRuntime(754): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1180)
10-26 12:22:35.155: E/AndroidRuntime(754): at android.os.Handler.dispatchMessage(Handler.java:99)
10-26 12:22:35.155: E/AndroidRuntime(754): at android.os.Looper.loop(Looper.java:137)
10-26 12:22:35.155: E/AndroidRuntime(754): at android.app.ActivityThread.main(ActivityThread.java:4424)
10-26 12:22:35.155: E/AndroidRuntime(754): at java.lang.reflect.Method.invokeNative(Native Method)
10-26 12:22:35.155: E/AndroidRuntime(754): at java.lang.reflect.Method.invoke(Method.java:511)
10-26 12:22:35.155: E/AndroidRuntime(754): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
10-26 12:22:35.155: E/AndroidRuntime(754): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
10-26 12:22:35.155: E/AndroidRuntime(754): at dalvik.system.NativeStart.main(Native Method)
10-26 12:22:35.155: E/AndroidRuntime(754): Caused by: java.lang.IllegalArgumentException: Receiver not registered: com.google.android.gcm.GCMBroadcastReceiver#412bc5c0
10-26 12:22:35.155: E/AndroidRuntime(754): at android.app.LoadedApk.forgetReceiverDispatcher(LoadedApk.java:628)
10-26 12:22:35.155: E/AndroidRuntime(754): at android.app.ContextImpl.unregisterReceiver(ContextImpl.java:1066)
10-26 12:22:35.155: E/AndroidRuntime(754): at android.content.ContextWrapper.unregisterReceiver(ContextWrapper.java:354)
10-26 12:22:35.155: E/AndroidRuntime(754): at com.google.android.gcm.GCMRegistrar.onDestroy(GCMRegistrar.java:266)
10-26 12:22:35.155: E/AndroidRuntime(754): at nl.easy.gcmnotification.MainActivity.onDestroy(MainActivity.java:49)
10-26 12:22:35.155: E/AndroidRuntime(754): at android.app.Activity.performDestroy(Activity.java:4629)
10-26 12:22:35.155: E/AndroidRuntime(754): at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1079)
10-26 12:22:35.155: E/AndroidRuntime(754): at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3099)
10-26 12:22:35.155: E/AndroidRuntime(754): ... 11 more

Can you post the code used for destroying the activity ?
I think your problem is the same as this one :
GCMRegistrar.onDestroy(context) crashing, Receiver not registered
Another potential issue : Did you declare the service in your manifest ?

The problem is fixed by restarting eclipse and clean/rebuild the project... Strange but true!

Related

YouTube player for android crashes on ads playback

We use Android Youtube API in out application. Lately I noticed that application crashes every time I try to play a video with enabled ads.
I'm able to reproduce it using their sample applications. I've tried SimplePlayerFragment and SimplePlayerView examples. Both crash when I try to cue the http://www.youtube.com/watch?v=QudbrUcVPxk video (this is just an example, other videos with ads are failing too).
Here is LogCat output:
10-26 19:10:49.074: E/AndroidRuntime(21637): FATAL EXCEPTION: main
10-26 19:10:49.074: E/AndroidRuntime(21637):
java.lang.IllegalStateException: android.os.DeadObjectException 10-26
19:10:49.074: E/AndroidRuntime(21637): at
com.google.android.apps.youtube.api.jar.a.eo.surfaceDestroyed(SourceFile:236)
10-26 19:10:49.074: E/AndroidRuntime(21637): at
android.view.SurfaceView.updateWindow(SurfaceView.java:555) 10-26
19:10:49.074: E/AndroidRuntime(21637): at
android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:232)
10-26 19:10:49.074: E/AndroidRuntime(21637): at
android.view.View.dispatchDetachedFromWindow(View.java:12156) 10-26
19:10:49.074: E/AndroidRuntime(21637): at
android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2565)
10-26 19:10:49.074: E/AndroidRuntime(21637): at
android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:2565)
10-26 19:10:49.074: E/AndroidRuntime(21637): at
android.view.ViewGroup.removeViewInternal(ViewGroup.java:3785) 10-26
19:10:49.074: E/AndroidRuntime(21637): at
android.view.ViewGroup.removeViewInternal(ViewGroup.java:3758) 10-26
19:10:49.074: E/AndroidRuntime(21637): at
android.view.ViewGroup.removeView(ViewGroup.java:3690) 10-26
19:10:49.074: E/AndroidRuntime(21637): at
com.google.android.youtube.player.YouTubePlayerView$1.b(Unknown
Source) 10-26 19:10:49.074: E/AndroidRuntime(21637): at
com.google.android.youtube.player.internal.r.h(Unknown Source) 10-26
19:10:49.074: E/AndroidRuntime(21637): at
com.google.android.youtube.player.internal.r$e.onServiceDisconnected(Unknown
Source) 10-26 19:10:49.074: E/AndroidRuntime(21637): at
android.app.LoadedApk$ServiceDispatcher.doDeath(LoadedApk.java:1111)
10-26 19:10:49.074: E/AndroidRuntime(21637): at
android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1125)
10-26 19:10:49.074: E/AndroidRuntime(21637): at
android.os.Handler.handleCallback(Handler.java:730) 10-26
19:10:49.074: E/AndroidRuntime(21637): at
android.os.Handler.dispatchMessage(Handler.java:92) 10-26
19:10:49.074: E/AndroidRuntime(21637): at
android.os.Looper.loop(Looper.java:137) 10-26 19:10:49.074:
E/AndroidRuntime(21637): at
android.app.ActivityThread.main(ActivityThread.java:5103) 10-26
19:10:49.074: E/AndroidRuntime(21637): at
java.lang.reflect.Method.invokeNative(Native Method) 10-26
19:10:49.074: E/AndroidRuntime(21637): at
java.lang.reflect.Method.invoke(Method.java:525) 10-26 19:10:49.074:
E/AndroidRuntime(21637): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
10-26 19:10:49.074: E/AndroidRuntime(21637): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 10-26
19:10:49.074: E/AndroidRuntime(21637): at
dalvik.system.NativeStart.main(Native Method) 10-26 19:10:49.074:
E/AndroidRuntime(21637): Caused by: android.os.DeadObjectException
10-26 19:10:49.074: E/AndroidRuntime(21637): at
android.os.BinderProxy.transact(Native Method) 10-26 19:10:49.074:
E/AndroidRuntime(21637): at
com.google.android.apps.youtube.api.b.a.be.a(SourceFile:221) 10-26
19:10:49.074: E/AndroidRuntime(21637): at
com.google.android.apps.youtube.api.jar.a.eo.surfaceDestroyed(SourceFile:233)
10-26 19:10:49.074: E/AndroidRuntime(21637): ... 22 more
I'd appreciate any ideas on how to solve the problem.
UPD:
Thanks to #septagon, found another related LogCat message:
10-27 16:58:51.763: D/YouTubeAndroidPlayerAPI(25196):
apps.youtube.core.client.DefaultAdStatsClient.a:485 Pinging
__AWCl-JGAkAHIAQWpAn4krwpwE7A-4AIAqAMBmAQFqgSwAU_QADdeVEnDazwBrSnaYs3R1HBqy45Cu537TEJ3YTBlvSni0sRdoz7KdLcSM8GN-htn40LlHEa78Q0Wc-Hrk04QcefoGDWqXcyn7fC6U9J6CfOz_J6n509CB7hJfQX2xrj2YTLwO2_AeK-bj9k3KWULoKQv_ZBYw5PfzGYPi2xuSOmQuuFoYcr0atVp-oLKiFDMrNiGhAsjaCbg8jlG43cEZZZ-VSGq1f9Oz1b-XQKw4AQBiAXhiftBkgUGCAMQARgBkgUGCAQQBRgKkgUGCAQQARgBkgUGCAYQARgBkgUECAYYA5AGAaAGHNgGAoAHuaXfLA&sigh=PjCzMkHYDKo&cid=5Gi9PCMcr3WKhFJWqILtjrdq&template_id=213">http://pubads.g.doubleclick.net/pagead/adview?ai=Cr6PgkatsUt7LE8GpmgXc3oHwBbGx9t8DsZHlu3Kx0vmLARABIOP7kwNQ4vr5ivj___AWCl-JGAkAHIAQWpAn4krwpwE7A-4AIAqAMBmAQFqgSwAU_QADdeVEnDazwBrSnaYs3R1HBqy45Cu537TEJ3YTBlvSni0sRdoz7KdLcSM8GN-htn40LlHEa78Q0Wc-Hrk04QcefoGDWqXcyn7fC6U9J6CfOz_J6n509CB7hJfQX2xrj2YTLwO2_AeK-bj9k3KWULoKQv_ZBYw5PfzGYPi2xuSOmQuuFoYcr0atVp-oLKiFDMrNiGhAsjaCbg8jlG43cEZZZ-VSGq1f9Oz1b-XQKw4AQBiAXhiftBkgUGCAMQARgBkgUGCAQQBRgKkgUGCAQQARgBkgUGCAYQARgBkgUECAYYA5AGAaAGHNgGAoAHuaXfLA&sigh=PjCzMkHYDKo&cid=5Gi9PCMcr3WKhFJWqILtjrdq&template_id=213
10-27 16:58:51.763: D/AndroidRuntime(25196): Shutting down VM 10-27
16:58:51.763: W/dalvikvm(25196): threadid=1: thread exiting with
uncaught exception (group=0x4158d700) 10-27 16:58:51.773:
E/AndroidRuntime(25196): FATAL EXCEPTION: main 10-27 16:58:51.773:
E/AndroidRuntime(25196): java.lang.NullPointerException 10-27
16:58:51.773: E/AndroidRuntime(25196): at
com.google.android.apps.youtube.core.player.AdStatsMacros.a(SourceFile:185)
10-27 16:58:51.773: E/AndroidRuntime(25196): at
com.google.android.apps.youtube.core.client.DefaultAdStatsClient.a(SourceFile:481)
10-27 16:58:51.773: E/AndroidRuntime(25196): at
com.google.android.apps.youtube.core.client.DefaultAdStatsClient.a(SourceFile:467)
10-27 16:58:51.773: E/AndroidRuntime(25196): at
com.google.android.apps.youtube.core.client.DefaultAdStatsClient.a(SourceFile:461)
10-27 16:58:51.773: E/AndroidRuntime(25196): at
com.google.android.apps.youtube.core.client.DefaultAdStatsClient.h(SourceFile:320)
10-27 16:58:51.773: E/AndroidRuntime(25196): at
com.google.android.apps.youtube.core.player.StatsTracker.g(SourceFile:409)
10-27 16:58:51.773: E/AndroidRuntime(25196): at
com.google.android.apps.youtube.core.player.an.handleMessage(SourceFile:1615)
10-27 16:58:51.773: E/AndroidRuntime(25196): at
android.os.Handler.dispatchMessage(Handler.java:95) 10-27
16:58:51.773: E/AndroidRuntime(25196): at
android.os.Looper.loop(Looper.java:137) 10-27 16:58:51.773:
E/AndroidRuntime(25196): at
android.app.ActivityThread.main(ActivityThread.java:5103) 10-27
16:58:51.773: E/AndroidRuntime(25196): at
java.lang.reflect.Method.invokeNative(Native Method) 10-27
16:58:51.773: E/AndroidRuntime(25196): at
java.lang.reflect.Method.invoke(Method.java:525) 10-27 16:58:51.773:
E/AndroidRuntime(25196): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
10-27 16:58:51.773: E/AndroidRuntime(25196): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 10-27
16:58:51.773: E/AndroidRuntime(25196): at
dalvik.system.NativeStart.main(Native Method)
There is bug filed in public issue tracker.
You can track the progress from there.
Bug is also filed internally.
I encounter the same problem too using my Galaxy S4 with the latest version of youtube.
I tried it on my Gnex which does not have the most recent version of youtube and of course everything works fine. seems like the last update made a mess.
Is there any other way to get their attention? is there a way to remove the latest update (just for now, to continue with the development) ?
And for a different topic, have you tried the getCurrentTimeMillis method more than once a second? do you get different time stamps or just the same when you call it more than once a second (say once every 100ms) ?
Thanks,
Roy
Check your unfiltered logcat for a NullPointerException coming from com.google.android.apps.youtube.core.player.AdStatsMacros. If you can find such an error, you're probably having the same problem as I and this question are experiencing.
Youtube Player API android crashes on playback on some devices
I can confirm that this error has been introduced within the last seventy-two hours and caused a flawlessly-working app to crash whenever an ad tries to play. The error appears to be coming from deep inside the YouTube Player API jar. Nothing seems to be confirmed yet, but it looks like YouTube is trying something new on their API back-end and having some troubles.

Unable to open stack trace file '/data/anr/jbt/jbt.907.tmp': No such file or directory?

My programe runs but i get the above mentioned eroor in logcat what is the reason i could not no getting so help me in this regard. I am providing my stack trace. If any body knows why this error comes please let me know
10-26 06:55:55.248: W/System.err(981): at android.app.ActivityThread.main(ActivityThread.java:3814)
10-26 06:55:55.248: W/System.err(981): at java.lang.reflect.Method.invokeNative(Native Method)
10-26 06:55:55.248: W/System.err(981): at java.lang.reflect.Method.invoke(Method.java:538)
10-26 06:55:55.248: W/System.err(981): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
10-26 06:55:55.248: W/System.err(981): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:659)
10-26 06:55:55.248: W/System.err(981): at dalvik.system.NativeStart.main(Native Method)
10-26 06:55:55.248: W/System.err(981): Caused by: java.lang.NullPointerException
10-26 06:55:55.248: W/System.err(981): at com.simsys.securex.PolicyReceiver.onReceive(PolicyReceiver.java:821)
10-26 06:55:55.248: W/System.err(981): at android.app.ActivityThread.handleReceiver(ActivityThread.java:1888)
10-26 06:55:55.248: W/System.err(981): ... 10 more
10-26 06:56:05.529: I/dalvikvm(981): threadid=4: reacting to signal 3
10-26 06:56:05.529: D/dalvikvm(981): SigQuit + : 0
10-26 06:56:05.533: I/dalvikvm(981): Wrote stack traces to '/data/anr/traces.txt'
10-26 06:56:05.543: E/dalvikvm(981): Unable to open stack trace file '/data/anr/jbt/jbt.981.tmp': No such file or directory
10-26 06:56:05.543: D/dalvikvm(981): SigQuit - : 0
10-26 06:59:19.745: I/dalvikvm(1043): threadid=4: reacting to signal 3
10-26 06:59:19.745: D/dalvikvm(1043): SigQuit + : 0
10-26 06:59:19.757: I/dalvikvm(1043): Wrote stack traces to '/data/anr/traces.txt'
10-26 06:59:19.765: E/dalvikvm(1043): Unable to open stack trace file '/data/anr/jbt/jbt.1043.tmp': No such file or directory
10-26 06:59:19.765: D/dalvikvm(1043): SigQuit - : 0
10-26 06:59:32.834: D/AndroidRuntime(1135): Shutting down VM
10-26 06:59:32.834: W/dalvikvm(1135): threadid=1: thread exiting with uncaught exception (group=0x4001c648)
10-26 06:59:32.838: W/System.err(1135): java.lang.RuntimeException: Unable to start receiver com.simsys.securex.PolicyReceiver: java.lang.NullPointerException
10-26 06:59:32.839: W/System.err(1135): at android.app.ActivityThread.handleReceiver(ActivityThread.java:1899)
10-26 06:59:32.839: W/System.err(1135): at android.app.ActivityThread.access$2400(ActivityThread.java:155)
10-26 06:59:32.839: W/System.err(1135): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1043)
10-26 06:59:32.839: W/System.err(1135): at android.os.Handler.dispatchMessage(Handler.java:130)
10-26 06:59:32.840: W/System.err(1135): at android.os.Looper.loop(SourceFile:351)
10-26 06:59:32.840: W/System.err(1135): at android.app.ActivityThread.main(ActivityThread.java:3814)
10-26 06:59:32.840: W/System.err(1135): at java.lang.reflect.Method.invokeNative(Native Method)
10-26 06:59:32.840: W/System.err(1135): at java.lang.reflect.Method.invoke(Method.java:538)
10-26 06:59:32.840: W/System.err(1135): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
10-26 06:59:32.841: W/System.err(1135): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:659)
10-26 06:59:32.841: W/System.err(1135): at dalvik.system.NativeStart.main(Native Method)
10-26 06:59:32.841: W/System.err(1135): Caused by: java.lang.NullPointerException
10-26 06:59:32.841: W/System.err(1135): at com.simsys.securex.PolicyReceiver.onReceive(PolicyReceiver.java:821)
10-26 06:59:32.841: W/System.err(1135): at android.app.ActivityThread.handleReceiver(ActivityThread.java:1888)
10-26 06:59:32.842: W/System.err(1135): ... 10 more
10-26 06:59:43.649: I/dalvikvm(1135): threadid=4: reacting to signal 3
10-26 06:59:43.649: D/dalvikvm(1135): SigQuit + : 0
10-26 06:59:43.653: I/dalvikvm(1135): Wrote stack traces to '/data/anr/traces.txt'
10-26 06:59:43.664: E/dalvikvm(1135): Unable to open stack trace file '/data/anr/jbt/jbt.1135.tmp': No such file or directory
10-26 06:59:43.664: D/dalvikvm(1135): SigQuit - : 0
10-26 07:01:01.606: I/dalvikvm(1184): threadid=4: reacting to signal 3
10-26 07:01:01.606: D/dalvikvm(1184): SigQuit + : 0
10-26 07:01:01.611: I/dalvikvm(1184): Wrote stack traces to '/data/anr/traces.txt'
10-26 07:01:01.613: E/dalvikvm(1184): Unable to open stack trace file '/data/anr/jbt/jbt.1184.tmp': No such file or directory
10-26 07:01:01.613: D/dalvikvm(1184): SigQuit - : 0
There is an attempt to access some null object at line 821 of your PolicyReceiver.java file.
Regarding the Unable to open stack trace file error messages, they seem to be a common problem of some Android system builds. The system tries but fails to write some information that could help you debug your actual bug. This is not relevant for you because you already have this information in the log you see with logcat.

Displaying live UDP or RTP stream (multicast) on Android

I am new to Android development since a few weeks, and I need to write an app that can display the user a live stream multicasted in UDP or RDP. The stream is located at an address such as "rtp://230.0.0.11:1234", and is emitted by WIFI thanks to this module :
http://www.ikusi.es/public/ctrl_public_prod.php?accion=verProducto&id_familia=34&id_gama=186&id_producto=351
I already tried to read it from a player (Daroon player, from PlayStore), and it worked well, so I assume that my foolowing problem is not due to the broadcast.
I saw that it is possible to display video content to the user by different ways :
Using a new Intent with an ACTION_VIEW, and Android selects an app that can view the content;
Using the MediaPlayer class and VideoView.
I have two issues, let us start with the most important :
- For both solution above, there is an issue : I read everywhere that MediaPlayer only support http/s and rtsp protocols, is that right? And for the action view here is what I tried before :
Uri streamURL = Uri.parse("rtp://230.0.0.11:1234");
Intent streamIntent = new Intent(Intent.ACTION_VIEW);
streamIntent.setData(streamURL);
// streamIntent.setDataAndType(streamURL,"video/*");
startActivity(streamIntent);
Here is the LogCat :
07-11 00:25:58.119: D/AndroidRuntime(2659): Shutting down VM
07-11 00:25:58.119: W/dalvikvm(2659): threadid=1: thread exiting with uncaught exception (group=0x40015560)
07-11 00:25:58.129: E/AndroidRuntime(2659): FATAL EXCEPTION: main
07-11 00:25:58.129: E/AndroidRuntime(2659): java.lang.IllegalStateException: Could not execute method of the activity
07-11 00:25:58.129: E/AndroidRuntime(2659): at android.view.View$1.onClick(View.java:2144)
07-11 00:25:58.129: E/AndroidRuntime(2659): at android.view.View.performClick(View.java:2485)
07-11 00:25:58.129: E/AndroidRuntime(2659): at android.view.View$PerformClick.run(View.java:9080)
07-11 00:25:58.129: E/AndroidRuntime(2659): at android.os.Handler.handleCallback(Handler.java:587)
07-11 00:25:58.129: E/AndroidRuntime(2659): at android.os.Handler.dispatchMessage(Handler.java:92)
07-11 00:25:58.129: E/AndroidRuntime(2659): at android.os.Looper.loop(Looper.java:123)
07-11 00:25:58.129: E/AndroidRuntime(2659): at android.app.ActivityThread.main(ActivityThread.java:3683)
07-11 00:25:58.129: E/AndroidRuntime(2659): at java.lang.reflect.Method.invokeNative(Native Method)
07-11 00:25:58.129: E/AndroidRuntime(2659): at java.lang.reflect.Method.invoke(Method.java:507)
07-11 00:25:58.129: E/AndroidRuntime(2659): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
07-11 00:25:58.129: E/AndroidRuntime(2659): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
07-11 00:25:58.129: E/AndroidRuntime(2659): at dalvik.system.NativeStart.main(Native Method)
07-11 00:25:58.129: E/AndroidRuntime(2659): Caused by: java.lang.reflect.InvocationTargetException
07-11 00:25:58.129: E/AndroidRuntime(2659): at java.lang.reflect.Method.invokeNative(Native Method)
07-11 00:25:58.129: E/AndroidRuntime(2659): at java.lang.reflect.Method.invoke(Method.java:507)
07-11 00:25:58.129: E/AndroidRuntime(2659): at android.view.View$1.onClick(View.java:2139)
07-11 00:25:58.129: E/AndroidRuntime(2659): ... 11 more
07-11 00:25:58.129: E/AndroidRuntime(2659): Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW dat=rtp://230.0.0.11:1234 }
07-11 00:25:58.129: E/AndroidRuntime(2659): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1409)
07-11 00:25:58.129: E/AndroidRuntime(2659): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
07-11 00:25:58.129: E/AndroidRuntime(2659): at android.app.Activity.startActivityForResult(Activity.java:2827)
07-11 00:25:58.129: E/AndroidRuntime(2659): at android.app.Activity.startActivity(Activity.java:2933)
07-11 00:25:58.129: E/AndroidRuntime(2659): at fr.infosat.tvreplay.MainActivity.listStream(MainActivity.java:35)
07-11 00:25:58.129: E/AndroidRuntime(2659): ... 14 more
07-11 00:26:00.079: I/Process(2659): Sending signal. PID: 2659 SIG: 9
My understanding is that the error InvocationTargetException, usually due to error on class names, cannot be resolved directly here, since I don't call any class in startActivity. However I think my syntax is not correct, maybe the method is not the right one to use. Of course if I uncomment the setDataAndType line, it displays the same error.
I noticed the error come when I launch my implicit intent.
My second problem is that Daroon Player works well on my set top box, I can see my stream on my TV. But when I try to launch it from Eclipse emulator, it doesn't play, even if I can play it from VLC... Is the emulator powerful enough to read those kind of stream?
I hope that you have some clues on how to solve that! :)
First, you get the exception because there is no app installed on your device which can handle such an rtp:// url.
You may want to check the intent before you start it: queryIntentActivities(..)
Second, I think emulator is pretty slow compared to any available real device, you may not want to use emulator to test A/V streaming.
VLC Android SDK works really perfect in UDP/RTP
https://code.videolan.org/videolan/vlc-android
libvlc

How to display an image in an image button with shared preferences?

In one of my activities you can click on an image button and a dialog opens up to ask you to open up the Gallery. Once opened up you can click on one of those images in your gallery.
What I want that the clicked image is set as the image of the image button. This image should stay there even when the user kills the app (when he opens up the app again the chosen image should still be there).
I chose to do all this work with the shared preferences but can't get it working. I get an error when I click on an image in the gallery. Any suggestions??
UPDATE: The error I receive is:
Unfortunately, the process com.myname.android has stopped
Here is my code, beginning with the onActivityResult:
private String selectedImagePath;
private String mFileName;
#Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
if (requestCode == PICK_FROM_FILE) {
Uri selectedImageUri = data.getData();
selectedImagePath = getPath(selectedImageUri);
Log.v("IMAGE PATH====>>>> ",selectedImagePath);
}
storePath();
retrievePath();
convertPathToImage();
}
}
private void storePath() {
final SharedPreferences sPreference = getSharedPreferences(
"pref_key", MODE_PRIVATE);
final Editor spEditor = sPreference.edit();
spEditor.putString("img_path", mFileName);
spEditor.commit();
}
private void retrievePath() {
final SharedPreferences sharedPreference = getSharedPreferences(
"pref_key", MODE_PRIVATE);
if (sharedPreference.contains("img_path")) {
mFileName = sharedPreference.getString("img_path",
null);
}
}
private void convertPathToImage() {
File imgFile = new File(mFileName);
if(imgFile.exists()){
Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath());
ImageButton myImage = (ImageButton) findViewById(R.id.image);
myImage.setImageBitmap(myBitmap);
}
}
And here is the LogCat:
05-30 15:27:14.567: D/dalvikvm(634): GC_CONCURRENT freed 1K, 3% free 11478K/11783K, paused 5ms+4ms
05-30 15:27:14.597: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:14.617: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:14.926: D/gralloc_goldfish(634): Emulator without GPU emulation detected.
05-30 15:27:26.767: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:26.877: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:30.616: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:30.626: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:32.086: W/IInputConnectionWrapper(634): showStatusIcon on inactive InputConnection
05-30 15:27:33.366: E/ActivityThread(634): Activity com.android.internal.app.ChooserActivity has leaked IntentReceiver com.android.internal.app.ResolverActivity$1#4155da80 that was originally registered here. Are you missing a call to unregisterReceiver()?
05-30 15:27:33.366: E/ActivityThread(634): android.app.IntentReceiverLeaked: Activity com.android.internal.app.ChooserActivity has leaked IntentReceiver com.android.internal.app.ResolverActivity$1#4155da80 that was originally registered here. Are you missing a call to unregisterReceiver()?
05-30 15:27:33.366: E/ActivityThread(634): at android.app.LoadedApk$ReceiverDispatcher.<init>(LoadedApk.java:763)
05-30 15:27:33.366: E/ActivityThread(634): at android.app.LoadedApk.getReceiverDispatcher(LoadedApk.java:567)
05-30 15:27:33.366: E/ActivityThread(634): at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1043)
05-30 15:27:33.366: E/ActivityThread(634): at android.app.ContextImpl.registerReceiver(ContextImpl.java:1030)
05-30 15:27:33.366: E/ActivityThread(634): at android.app.ContextImpl.registerReceiver(ContextImpl.java:1024)
05-30 15:27:33.366: E/ActivityThread(634): at android.content.ContextWrapper.registerReceiver(ContextWrapper.java:341)
05-30 15:27:33.366: E/ActivityThread(634): at com.android.internal.content.PackageMonitor.register(PackageMonitor.java:65)
05-30 15:27:33.366: E/ActivityThread(634): at com.android.internal.app.ResolverActivity.onCreate(ResolverActivity.java:99)
05-30 15:27:33.366: E/ActivityThread(634): at com.android.internal.app.ChooserActivity.onCreate(ChooserActivity.java:53)
05-30 15:27:33.366: E/ActivityThread(634): at android.app.Activity.performCreate(Activity.java:4465)
05-30 15:27:33.366: E/ActivityThread(634): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
05-30 15:27:33.366: E/ActivityThread(634): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
05-30 15:27:33.366: E/ActivityThread(634): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
05-30 15:27:33.366: E/ActivityThread(634): at android.app.ActivityThread.access$600(ActivityThread.java:123)
05-30 15:27:33.366: E/ActivityThread(634): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
05-30 15:27:33.366: E/ActivityThread(634): at android.os.Handler.dispatchMessage(Handler.java:99)
05-30 15:27:33.366: E/ActivityThread(634): at android.os.Looper.loop(Looper.java:137)
05-30 15:27:33.366: E/ActivityThread(634): at android.app.ActivityThread.main(ActivityThread.java:4424)
05-30 15:27:33.366: E/ActivityThread(634): at java.lang.reflect.Method.invokeNative(Native Method)
05-30 15:27:33.366: E/ActivityThread(634): at java.lang.reflect.Method.invoke(Method.java:511)
05-30 15:27:33.366: E/ActivityThread(634): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-30 15:27:33.366: E/ActivityThread(634): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-30 15:27:33.366: E/ActivityThread(634): at dalvik.system.NativeStart.main(Native Method)
05-30 15:27:35.987: V/IMAGE PATH====>>>>(634): /mnt/sdcard/Mercedes_SLS_AMG.jpg
05-30 15:27:36.176: D/AndroidRuntime(634): Shutting down VM
05-30 15:27:36.176: W/dalvikvm(634): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
05-30 15:27:36.206: E/AndroidRuntime(634): FATAL EXCEPTION: main
05-30 15:27:36.206: E/AndroidRuntime(634): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=Intent { dat=content://media/external/images/media/20 }} to activity {com.xyz.android.taskreminder/com.xyz.android.taskreminder.ReminderEditActivity}: java.lang.NullPointerException
05-30 15:27:36.206: E/AndroidRuntime(634): at android.app.ActivityThread.deliverResults(ActivityThread.java:2980)
05-30 15:27:36.206: E/AndroidRuntime(634): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3023)
05-30 15:27:36.206: E/AndroidRuntime(634): at android.app.ActivityThread.access$1100(ActivityThread.java:123)
05-30 15:27:36.206: E/AndroidRuntime(634): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1177)
05-30 15:27:36.206: E/AndroidRuntime(634): at android.os.Handler.dispatchMessage(Handler.java:99)
05-30 15:27:36.206: E/AndroidRuntime(634): at android.os.Looper.loop(Looper.java:137)
05-30 15:27:36.206: E/AndroidRuntime(634): at android.app.ActivityThread.main(ActivityThread.java:4424)
05-30 15:27:36.206: E/AndroidRuntime(634): at java.lang.reflect.Method.invokeNative(Native Method)
05-30 15:27:36.206: E/AndroidRuntime(634): at java.lang.reflect.Method.invoke(Method.java:511)
05-30 15:27:36.206: E/AndroidRuntime(634): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
05-30 15:27:36.206: E/AndroidRuntime(634): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
05-30 15:27:36.206: E/AndroidRuntime(634): at dalvik.system.NativeStart.main(Native Method)
05-30 15:27:36.206: E/AndroidRuntime(634): Caused by: java.lang.NullPointerException
05-30 15:27:36.206: E/AndroidRuntime(634): at java.io.File.fixSlashes(File.java:185)
05-30 15:27:36.206: E/AndroidRuntime(634): at java.io.File.<init>(File.java:134)
05-30 15:27:36.206: E/AndroidRuntime(634): at com.xyz.android.taskreminder.ReminderEditActivity.convertPathToImage(ReminderEditActivity.java:249)
05-30 15:27:36.206: E/AndroidRuntime(634): at com.xyz.android.taskreminder.ReminderEditActivity.onActivityResult(ReminderEditActivity.java:227)
05-30 15:27:36.206: E/AndroidRuntime(634): at android.app.Activity.dispatchActivityResult(Activity.java:4649)
05-30 15:27:36.206: E/AndroidRuntime(634): at android.app.ActivityThread.deliverResults(ActivityThread.java:2976)
05-30 15:27:36.206: E/AndroidRuntime(634): ... 11 more
05-30 15:27:36.376: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:36.396: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:36.787: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:36.847: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:37.386: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:37.406: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:37.887: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:37.947: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:38.396: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:38.416: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:38.897: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:38.927: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:39.406: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:39.426: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:39.917: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:39.927: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:40.426: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:40.446: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:40.917: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:40.947: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:41.426: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:41.447: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:41.937: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:41.977: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:42.446: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:42.467: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:42.937: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:42.956: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:43.446: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:43.467: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:43.947: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:43.976: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:44.456: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:44.477: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:44.966: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:44.986: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
05-30 15:27:45.466: I/dalvikvm(634): threadid=3: reacting to signal 3
05-30 15:27:45.487: I/dalvikvm(634): Wrote stack traces to '/data/anr/traces.txt'
Activity com.android.internal.app.ChooserActivity has leaked IntentReceiver com.android.internal.app.ResolverActivity$1#4155da80 that was originally registered here. Are you missing a call to unregisterReceiver()?
This is probably a bug in Android. See http://code.google.com/p/android/issues/detail?id=29399. It shouldn't effect the app though which should still be able to get a result back from the gallery.
05-30 15:27:36.206: E/AndroidRuntime(634): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=Intent { dat=content://media/external/images/media/20 }} to activity {com.ndroidstudios.android.taskreminder/com.ndroidstudios.android.taskreminder.ReminderEditActivity}: java.lang.NullPointerException
...
05-30 15:27:36.206: E/AndroidRuntime(634): Caused by: java.lang.NullPointerException
This is the problem. mFileName is null when you try to use it to create a new File. In retrievePath, when you try to pull "img_path" out of your preferences the default value is null, so I'm guessing it's getting set to null there. Check in the debugger to make sure mFileName is getting set to a valid String from your preferences.

opening google map in a tab in android not working

I'm trying to open a google map application I did in a tab but its not working, it keep getting the force close message when I run it. I created the main activity file[TabtestingActivity] which creates the tabs [HelloGoogleActivity class contains the map code and it works fine without tabs]
public class TabstestingActivity extends TabActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Resources res = getResources();
TabHost tabHost = getTabHost(); // The activity TabHost
TabHost.TabSpec spec; // Reusable TabSpec for each tab
Intent intent; // Reusable Intent for each tab
intent = new Intent().setClass(this, HelloGoogleActivity.class);
spec = tabHost.newTabSpec("tabOne");
spec.setContent(intent);
spec.setIndicator("Tab One",res.getDrawable(R.drawable.tabselect));
tabHost.addTab(spec);
tabHost.setCurrentTab(0);
}
}
if I create a class which only has a text in it it works fine with tabs but when I add the map class it stops working.
This is my main.xml:
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<TabWidget
android:id="#android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="#android:id/tabcontent
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView
android:id="#+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="my key"
android:layout_weight="1"/>
</RelativeLayout>
</FrameLayout>
</LinearLayout>
</TabHost>
is there any problem with my main.xml?
This is the logcat:
10-26 00:47:10.207: ERROR/AndroidRuntime(303): FATAL EXCEPTION: main
10-26 00:47:10.207: ERROR/AndroidRuntime(303): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.tabtest/com.example.tabtest.TabstestingActivity}: android.view.InflateException: Binary XML file line #12: Error inflating class com.google.android.maps.MapView
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at android.os.Handler.dispatchMessage(Handler.java:99)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at android.os.Looper.loop(Looper.java:123)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at android.app.ActivityThread.main(ActivityThread.java:4627)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at java.lang.reflect.Method.invokeNative(Native Method)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at java.lang.reflect.Method.invoke(Method.java:521)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at dalvik.system.NativeStart.main(Native Method)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): Caused by: android.view.InflateException: Binary XML file line #12: Error inflating class com.google.android.maps.MapView
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at android.view.LayoutInflater.createView(LayoutInflater.java:513)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:565)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at android.app.Activity.setContentView(Activity.java:1647)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at com.example.tabtest.TabstestingActivity.onCreate(TabstestingActivity.java:15)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): ... 11 more
10-26 00:47:10.207: ERROR/AndroidRuntime(303): Caused by: java.lang.reflect.InvocationTargetException
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at com.google.android.maps.MapView.<init>(MapView.java:238)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at java.lang.reflect.Constructor.constructNative(Native Method)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at java.lang.reflect.Constructor.newInstance(Constructor.java:446)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at android.view.LayoutInflater.createView(LayoutInflater.java:500)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): ... 22 more
10-26 00:47:10.207: ERROR/AndroidRuntime(303): Caused by: java.lang.IllegalArgumentException: MapViews can only be created inside instances of MapActivity.
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at com.google.android.maps.MapView.<init>(MapView.java:282)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): at com.google.android.maps.MapView.<init>(MapView.java:255)
10-26 00:47:10.207: ERROR/AndroidRuntime(303): ... 26 more
The trace is pretty clear,
"10-26 00:47:10.207: ERROR/AndroidRuntime(303): Caused by: java.lang.IllegalArgumentException: MapViews can only be created inside instances of MapActivity."
You can't use the MapView outside of a MapActivity.

Categories

Resources