How can one save drawing on canvas in android, so that it could be restored at some point in future? For example, I save current drawing on canvas, then draw something else, and after that restore canvas to the previous saved state.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have to store the model data separately. In draw method you only define how to draw this data. Depending on the situation you can set a flag and in draw, draw the appropriate model.
You also can save the canvas as a file / bitmap, see for example this: Image on canvas to JPEG file