0

App crashes with no error messages when i try to send date to my main activity class.

I have a launchActivity thats run a Async process to load data. I then parse the json into classes and send them to the my MainActivity. However when i try to send the two objects that have data, the app crashes. but if i comment either one of them, it works.

intent.putExtra("class1", class1);
intent.putExtra("class2", class2);

both of my classes implement serializable. I was wondering is there a size limit to the intent ?

There is no system dialogu not any error message when the crash happens.

Logcat message - http://pastebin.com/Lz8W5KXK

Jayaram
  • 839
  • 1
  • 14
  • 24
  • Please post the logcat output. There should be a stack trace from the crash there. – Ted Hopp Oct 18 '15 at 04:01
  • There isn't any kind of error message in the log which is why i'm confused – Jayaram Oct 18 '15 at 04:04
  • What are the symptoms of the crash? Do you get a system dialog saying that the app has stopped? If so, it's hard to believe that there's nothing in logcat; the system will always log uncaught exceptions. – Ted Hopp Oct 18 '15 at 04:09
  • There's no system dialog either. checkout this link - http://pastebin.com/Lz8W5KXK – Jayaram Oct 18 '15 at 04:14

1 Answers1

0

For send objects, your object classes must implement serializable.

Example:

public class Class1 implements Serializable {...}

Then, you are able to do:

intent.putExtra("class1", class1);
Luiz
  • 325
  • 7
  • 28
  • But, if any of your classes have an attribute that is not serializable, like bitmap, the app will crash. Check this. – Luiz Oct 18 '15 at 04:31
  • both my classes have attributes that are either string or int – Jayaram Oct 18 '15 at 04:33
  • So, I think, the problem must be the size of the object. Like described here:http://stackoverflow.com/questions/12496700/maximum-length-of-intent-putextra-method-force-close The limit is less than 1Mb. – Luiz Oct 18 '15 at 04:35