how to save the activity in android while painting
<p>i made an application which is generally used to draw lines n figures.Suppose i made a square.now i want to save it and when i start my application again so i must see the square.how could it possible.
here is my code</p>

<pre><code>@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // Set full screen view
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                                     WindowManager.LayoutParams.FLAG_FULLSCREEN);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    DrawView drawView = new DrawView(this, null);
    setContentView(drawView);
    drawView.requestFocus();

}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // TODO Auto-generated method stub
    menu.add(0,1,1,"RED").setShortcut('3', 'C');
    menu.add(0,2,2,"GREEN");
    menu.add(0,3,3,"BLUE");
    menu.add(0,4,4,"Erase");
    return super.onCreateOptionsMenu(menu);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // TODO Auto-generated method stub
    switch(item.getItemId())
    {
    case 1:
        first(x,y,z);
        break;

    case 4:
        DrawView.second();
        break;
    }
    return super.onOptionsItemSelected(item);
}

public List&lt;Integer&gt; first(int x2, int y2, int z2) {
    // TODO Auto-generated method stub

    x2=100;y2=150;z2=200;
    al.add(x2);al.add(y2);al.add(z2);
    return al;

}
</code></pre>

<p>}</p>

<pre><code>  public DrawView(Context context, AttributeSet attrs) {
    super(context, attrs);
    list1 = d.first(a,b,c);   
    paint.setAntiAlias(true);
    paint.setColor(Color.rgb(list1.get(0),list1.get(1),list1.get(2)));
    paint.setStyle(Paint.Style.STROKE);
    paint.setStrokeJoin(Paint.Join.ROUND);
    paint.setStrokeWidth(5f);
  }

  @Override
  protected void onDraw(Canvas canvas) {
    canvas.drawPath(path, paint);
  }

  @Override
  public boolean onTouchEvent(MotionEvent event) {
    float eventX = event.getX();
    float eventY = event.getY();

    switch (event.getAction()) {
      case MotionEvent.ACTION_DOWN:
        path.moveTo(eventX, eventY);
        return true;
      case MotionEvent.ACTION_MOVE:
      case MotionEvent.ACTION_UP:
        path.lineTo(eventX, eventY);
        break;
      default:
        return false;
    }

    // Schedules a repaint.
    invalidate();
    return true;
  }

static void second() {
    // TODO Auto-generated method stub
    erase(paint);
}

private static void erase(Paint paint2) {
    // TODO Auto-generated method stub
    paint2.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.CLEAR));
}
</code></pre>

<p>}</p>
