List of usage examples for android.os Parcelable PARCELABLE_WRITE_RETURN_VALUE
int PARCELABLE_WRITE_RETURN_VALUE
To view the source code for android.os Parcelable PARCELABLE_WRITE_RETURN_VALUE.
Click Source Link
Parcelable someFunction()
", "void someFunction(out Parcelable)
", or "void someFunction(inout Parcelable)
". From source file:Main.java
public static boolean writeParcelable(Context context, String fileName, Parcelable parcelObject) { boolean success = false; FileOutputStream fos = null;/*from w w w. ja va 2s.c o m*/ try { fos = context.openFileOutput(fileName, Context.MODE_PRIVATE); Parcel parcel = Parcel.obtain(); parcel.writeParcelable(parcelObject, Parcelable.PARCELABLE_WRITE_RETURN_VALUE); byte[] data = parcel.marshall(); fos.write(data); success = true; } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { if (fos != null) { try { fos.close(); } catch (IOException ioe) { ioe.printStackTrace(); } } } return success; }