Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
De-Serializing Android Paths (http://stackoverflow.com/a/6643686/663370)
private List<SerializablePath> mAddedFPPaths = new ArrayList<SerializablePath>();
public void loadState() {
try {
FileInputStream fis = mContext.openFileInput(STATE_DATA);
ObjectInputStream ois = new ObjectInputStream(fis);
try {
mAddedFPPaths = (ArrayList<SerializablePath>)ois.readObject();
for (SerializablePath p : mAddedFPPaths) {
p.loadPathPointsAsQuadTo();
}
} catch (ClassNotFoundException ce) {
// ...
}
ois.close();
} catch (IOException e) {
// ...
}
}
// Then in your draw function something like this..
for (SerializablePath p : mAddedFPPaths) {
mPaintFP.setColor(p.getColor());
mPaintFP.setStrokeWidth(p.getStrokeWidth());
mPaintFP.setXfermode(null);
fpCanvas.drawPath(p, mPaintFP);
}
@AndroPlus

Hi, i am developing a scratch and guess game. Is it possible to store serialized path objects in Sqlite db ?.
Later i want to redraw whenever i want. Is it possible ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.