2011-12-08 3 views
0

내 데이터베이스의 일부 데이터 목록이 있습니다. 사용자가 목록의 모든 항목을 클릭하면 대화 상자를 갖기를 원합니다. 대화 상자의 레이아웃은 동일하지만 다른 텍스트는 database.My 문제는 같은 content..This으로 대화 상자를 점점 내 코드 메신저 내 온 클릭 코드로데이터베이스 목록 데이터 onClick

HotOrNot entry=new HotOrNot(this); 
         entry.open(); 
       Cursor cursor = entry.getData(); 
       startManagingCursor(cursor); 
       Dialog dialog = new Dialog(this); 

       dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); 
       dialog.setContentView(R.layout.agonessingle); 
       dialog.setCancelable(true);   

       String description2 = DBHelper.DESCRIPTION; 
        String skord2 = DBHelper.SKOR; 
        String goala2 = DBHelper.GOALA; 
        String goalb2 = DBHelper.GOALB; 
        String title2 = DBHelper.TITLE; 
         TextView firsttext = (TextView) dialog.findViewById(R.id.firstdialog); 
         firsttext.setText(title2); 

          TextView text = (TextView) dialog.findViewById(R.id.TextView1); 
          text.setText(description2); 
          TextView text2 = (TextView) dialog.findViewById(R.id.TextView2); 
          text2.setText(skord2); 
          TextView text3 = (TextView) dialog.findViewById(R.id.TextView3); 
          text3.setText(goala2); 
          TextView text4 = (TextView) dialog.findViewById(R.id.TextView4); 
          text4.setText(goalb2); 

          entry.close(); 
         dialog.show(); 

는이 작업의 CustomAdapter를 사용하는 것이 더 좋을 것입니다? 도와주세요, 내가 여기에 적재 한 몇일 동안!

답변

0

에는 내 데이터베이스의 일부 데이터 목록이 있습니다. 사용자가 목록의 모든 항목을 클릭하면 대화 상자가 나타납니다. 대화 상자에는 동일한 레이아웃이 있지만 database.My에서 가져온 다른 텍스트가 있습니다. 문제는 내 코드에서 동일한 내용의 대화를 가져 오는 것입니다. 내 클릭 코드는

입니다. onClick을 사용하는 경우 사용자가 클릭 할 때 대화 상수 즉 문자열 개체를 업데이트하고 대화 상자를 다시 설정해야합니다. .

+0

나에게 그걸 보여 주실 수 있습니까? –

관련 문제