Drawing app android: how to undo path, fill color -


i'm creating drawing app feature undo.my app can draw line, fill color. if app have feature draw line, have solution use array list store path , redraw when use tap undo app support fill color (paint bucket) feature. don't found best solution undo. have ideas??????

for undo , redo

 public void onclickundo () {   if (paths.size()>0) {     undonepaths.add(paths.remove(paths.size()-1))    invalidate();  }  else  //toast user  }  public void onclickredo (){ if (undonepaths.size()>0) {     paths.add(undonepaths.remove(undonepaths.size()-1))     invalidate(); }  else   //toast user  } 

Comments

Popular posts from this blog

java - Checkbox item adds to spinner -

C# MVC AngularJS -

php - mySQL problems with this code? -