0

I'm sending File[] array between two applications in an intent. On the receiving app I have a code that typecasts Serializable to File[].

File[] files = (File[]) intent.getSerializableExtra(RESULT_FILES);

I've been testing it and it works fine.

However when other guy was using same code with same application, he got type cast exception:

java.lang.ClassCastException: java.lang.Object[] cannot be cast to java.io.File[]

So I'm curios to know why Intent.getSerializableExtra() returns File[] object in my environment and Object[] with someone else?

Has that changed between android api or java versions?

As requested in comment, extra is put to intent with this code:

File[] files = fileCollection.compressAllQuitely();
intent.putExtra(RESULT_FILES, files);

So in a nutshell. I made application a.
I tested with application b. getSerializableExtra returns File[]
Another guys made own app c and tested agains application a. getSerializableExtra returns Object[]

rooste
  • 160
  • 9

0 Answers0