I have a class called "Core" which contains many classes such as "paths", "session", etc, etc. I am in Activity 1, when passing Activity 2 I reload all core data? (there are many), I need to pass data by data of all kinds through intent.putExtras (Bundle)? there any way to pass the "core" class? I tried to do that "core" is serializable but the compiler tells me it is impossible to transform the class serializable. I must charge the "core" class whenever changing activity? not do this much slower navigation? most core data obtained from the internet among many other very slow mathematical calculations which I figured I could make a unique look in Activity 1 and just after all the data out through arguments but does not work :(
Intent intent = new Intent(this, ActivityPanel1.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
Bundle argumentos = new Bundle();
argumentos.putSerializable("core", this.core); // <- The problem
intent.putExtras(argumentos);
startActivity(intent);
Result:
at android.app.ActivityThread.main(ActivityThread.java:5419)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:525)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.io.NotSerializableException: com.example.splash.SplashActivity
at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1364)
at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1671)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1517)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1481)