public class A extends Activity {
       public onCeate(Bundle savedInstanceState) {
                     MyListAdapter MyAdapter = new MyListAdapter(this, R.layout.listlayout, arItem);
                     ListView list = (ListView) findViewById(R.id.list);
                     list.setAdapter(MyAdapter);
       }

       class MyListAdapter extends BaseAdapter {
                Context maincon;
                LayoutInflater Inflater;
                ArrayList<MyItem> arSrc;
                int layout;

                public MyListAdapter(Context context, int alayout,
                            ArrayList<MyItem> aarSrc) {
                             maincon = context;
                             Inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                             arSrc = aarSrc;
                             layout = alayout;
                 }
                 public View getView(int position, View convertView, ViewGroup parent) { 
                                 btn.setListener(new Button.Listener() {
                                                    public void (View v) { 
                                                                   new AlertDialog.Builder(maincon).setTitle("다이얼로그").setMessage("안녕하세요).setIcosetCancelable(false).setNegativeButton("닫기", null).show();
                 }
        }
}


코드는 참조해주세요(중요한 부분만 넣었어요)
질문의 요지가 뭐냐면요 리스트뷰에 라인당 버튼을 한개씩 만들었어요.
그리고 사용자가 어떤 라인의 버튼을 클릭하면 그 라인에 정보를 보여주는 다이알로그를 띄울라고 해요.
그런데 문제가
new AlertDialog.Builder(maincon).setTitle("다이얼로그").setMessage("안녕하세요).setIcosetCancelable(false).setNegativeButton("닫기", null).show();
이 다이알로그를 띄우는 부분인데요. 아마도 maincon때문에 오류가 생기는것 같아요. Activity가 아닌 곳에서 다이알로그를 띄우려고 하니까 문제가 생기는건가...
Toast는 되는데 이건 왜 안될까요.
해결방법좀 알려주세요 고수님들