액티비티에서 setContentView(R.layout.tab3_add); 를 하여 화면을 띄웠고 


커스텀 다이얼로그를 띄우기위해 

 

  LayoutInflater inflater = (LayoutInflater) getParent().getSystemService(LAYOUT_INFLATER_SERVICE);
  
  View layout = inflater.inflate(R.layout.tab3_buy_dlg, null);
  dlg = new Dialog(getParent());
  dlg.setContentView(R.layout.tab3_buy_dlg);
  TextView tBuyValue = (TextView) layout.findViewById(R.id.tab3_buy_title);

  tBuyValue.setText(name); // 다이얼로그 타이틀 : 종목명(코드명)
  
  Button confirm = (Button) layout.findViewById(R.id.tab3_buy_confirm);
  Button cancle = (Button) layout.findViewById(R.id.tab3_buy_cancle);
  
  final EditText eBuyValue = (EditText) layout.findViewById(R.id.tab3_buy_value);
  final EditText eBuyAmount = (EditText) layout.findViewById(R.id.tab3_buy_amount);

탭호스트를 사용중이고 replaceView를 이용하여 화면 전환을 하기위해 getParent()를 사용하였습니다.

 

문제는 tBuyValue 에서 setText 가 먹히지 않는 것 (name 값은 있습니다)

Button에 대한 클릭리스너가 먹지 않습니다. 아래 클릭리스너 부분입니다

 

  OnClickListener listner = new OnClickListener(){
   @Override
   public void onClick(View v) {
    // TODO Auto-generated method stub
    
    String t1 = eBuyValue.toString();
    String t2 = eBuyAmount.toString();
    Log.e("", "event occured");
    switch(v.getId()){
    case R.id.tab3_buy_confirm:
     Log.e("", "confirm clicked");
     }
     break;
    case R.id.tab3_buy_cancle:
     Log.e("", "cancled clicked");
     break;
    }
   }
  };
  confirm.setOnClickListener(listner);
  cancle.setOnClickListener(listner);

제 생각에는  View layout = inflater.inflate(R.layout.tab3_buy_dlg, null); 여기에서 이벤트를 뺐어가는 것 같아서

layout에 별짓을 다해봤는데... 여전히 같더라구요... ㅜ 도움을 요청합니다
그리고 이벤트만 뺏어가는 것이라면 TextView 에서 setText는 되어야하는데 아무런 글자도 출력이 되지 않네요..