7
I have an Android app that sends data to a server via wireless, by sending changes from Activity B to A.
It turns out that when the connection is weak the application stops and gives the error below.
I understand from what I read in Soen this happens because by blocking my Activity B essential data is lost that would be passed from Activity B to A and hence the error.
Can someone tell me a way to fix this?
PS: The process has to be synchronous.
Error log:
09-30 14:47:22.999: E/Parcel(577): java.lang.Classnotfoundexception: com.exemplo.objetos.meuObjeto 09-30 14:47:22.999: E/Parcel(577): at java.lang.Class.classForName(Native Method) 09-30 14:47:22.999: E/Parcel(577): at java.lang.Class.forName(Class.java:251) 09-30 14:47:22.999: E/Parcel(577): at java.lang.Class.forName(Class.java:216) 09-30 14:47:22.999: E/Parcel(577): at android.os.Parcel.readParcelableCreator(Parcel.java:2140) 09-30 14:47:22.999: E/Parcel(577): at android.os.Parcel.readParcelable(Parcel.java:2104) 09-30 14:47:22.999: E/Parcel(577): at android.os.Parcel.readValue(Parcel.java:2020) 09-30 14:47:22.999: E/Parcel(577): at android.os.Parcel.readArrayMapInternal(Parcel.java:2321) 09-30 14:47:22.999: E/Parcel(577): at android.os.Bundle.unparcel(Bundle.java:249) 09-30 14:47:22.999: E/Parcel(577): at android.os.Bundle.getString(Bundle.java:1118) 09-30 14:47:22.999: E/Parcel(577): at android.content.Intent.getStringExtra(Intent.java:5145) 09-30 14:47:22.999: E/Parcel(577): at com.android.server.am.Activitystacksupervisor.startActivityLocked(Activitystacksupervisor.java:1466) 09-30 14:47:22.999: E/Parcel(577): at com.android.server.am.Activitystacksupervisor.startActivityMayWait(Activitystacksupervisor.java:1061) 09-30 14:47:22.999: E/Parcel(577): at com.android.server.am.Activitymanagerservice.startActivityAsUser(Activitymanagerservice.java:4067) 09-30 14:47:22.999: E/Parcel(577): at com.android.server.am.Activitymanagerservice.startActivity(Activitymanagerservice.java:3965) 09-30 14:47:22.999: E/Parcel(577): at android.app.Activitymanagernative.onTransact(Activitymanagernative.java:159) 09-30 14:47:22.999: E/Parcel(577): at com.android.server.am.Activitymanagerservice.onTransact(Activitymanagerservice.java:2646) 09-30 14:47:22.999: E/Parcel(577): at android.os.Binder.execTransact(Binder.java:404) 09-30 14:47:22.999: E/Parcel(577): at Dalvik.system.Nativestart.run(Native Method) 09-30 14:47:22.999: E/Parcel(577): Caused by: java.lang.Noclassdeffounderror: with/example/objects/meObject 09-30 14:47:22.999: E/Parcel(577): ... 18 more 09-30 14:47:22.999: E/Parcel(577): Caused by: java.lang.Classnotfoundexception: Didn’t find class "com.exemplo.objetos.meuObjeto" on path: Dexpathlist[[directory "." ],nativeLibraryDirectories=[/vendor/lib, /system/lib]] 09-30 14:47:22.999: E/Parcel(577): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) 09-30 14:47:22.999: E/Parcel(577): at java.lang.Classloader.loadClass(Classloader.java:497) 09-30 14:47:22.999: E/Parcel(577): at java.lang.Classloader.loadClass(Classloader.java:457)
Put a
catch Exception
:P :D– Maniero
@mustache your bad :P
– Jorge B.
That’s a small amount to help you. You’ll have to give more elements.
– ramaral
@ramaral I’m trying to reproduce. When I put more.
– Jorge B.
@ramaral already has the log.
– Jorge B.
Did the mistake happen in the same circumstances you described in the question? You know what it is
com.sdilab.objectos.meuObjeto
?– ramaral
@ramaral yes is an object that I use in a list in activity A
– Jorge B.
@ramaral alias is the object selected in A then B will make some changes, then when sending to the server the application goes back to A with the object docked.
– Jorge B.
By editing the question I suppose now the error has arisen in another situation. Can you describe it? I was going to ask if this object was passed to the other Activity but you already answered. As it is a mistake that only happens from time to time will not be easy to resolve without knowing under what circumstances it happens.
– ramaral
The situation is the same @ramaral I was not able to explain well when I created the question. It only happens sometimes, yes when the network is weak, this is because I have two states in the app, offline and online and everything goes well. The problem appears when the network signal is too weak.
– Jorge B.
@but the client happens frequently. I’ve tried to have him send me his log, but what he sent me had no mistake.
– Jorge B.
@ramaral forgot to mention I have an external library that makes me uploads to the server, I just wait for the result of it and continue running my app.
– Jorge B.
You can put the part of the code that makes/ handles this request?
– Igor Castañeda Ferreira