Dialog in View class
<p>I want to use Dialog in the class which is extended by View,</p>

<pre><code> public class CutView extends View {

       final static int SHORTCLICK_ACTION = 1;
       final static int LONGCLICK_ACTION = 2;

public CutView(final Context context, AttributeSet attrs) {
    super(context, attrs, 0);

    ctx=context;        
    curPoint = new Point();
    curPoint.x = 0;
    curPoint.y = 0;

    rx=-1; ry=-1;
    brushsize=20;
    showfinal=false;
    eraser=0;
    Check = 0;

    setImage(context);       
    paint = new Paint();         
    paint.setXfermode(new PorterDuffXfermode(Mode.SRC_OUT)); 
    paint.setColor(Color.TRANSPARENT);
    paint.setMaskFilter(new BlurMaskFilter(5, Blur.NORMAL));        
    erase = new Paint();
    erase.setColor(Color.BLACK);
    erase.setMaskFilter(new BlurMaskFilter(5, Blur.NORMAL));        

    setOnClickListener(new OnClickListener(){
        public void onClick(View v) {               
            showDialog(SHORTCLICK_ACTION);

           }            
    });

    setOnLongClickListener(new OnLongClickListener(){

        public boolean onLongClick(View v) {

            showDialog(LONGCLICK_ACTION);

            // TODO Auto-generated method stub
            return false;
        }
    });       

}
protected Dialog onCreateDialog(int id)
{
    Context con = getContext();
    Log.i("id:","" + id);
    switch (id)
    {       

        case 1:
            return new AlertDialog.Builder(con).setTitle("ACTIVE").setItems(R.array.shortclick_cutView, new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int which) {
                        if(which == 0)  
                        {   
                        }
                        else if(which == 1)
                        {
                            setOnTouchListener(new OnTouchListener(){
                                public boolean onTouch(View v, MotionEvent event) {

                                    move(event);

                                    return true;
                                }
                            });

                        }   
                    }
            }).create();

        case LONGCLICK_ACTION:
            return new AlertDialog.Builder(con).setTitle("이미지 관리").setItems(R.array.longclick_cutView, new DialogInterface.OnClickListener() {

                        public void onClick(DialogInterface dialog, int which) {
                            if(which == 0)  
                            {   
                            }
                            else if(which == 1)
                            {

                            }

                        }
            }).create();

    }
    return null;

}
</code></pre>

<p>in my code, Dialog did not make, so I tried to change on <code>onCreateDialog()</code> to <code>showDiaglog()</code>, But it doesn't work... I try to find solution, many solutions say I should use dialog in Activity class, But I want to use it in View class..... How can I make dialog in view class?????                                                               </p>
