2012-03-06 14 views
1

私は満足しているダイアログを作成しました。問題は、データベースからの情報でダイアログを開くことです。これでダイアログのレイアウトが完成しました。しかし、1つの事のために、データが呼び出されるフィールドボックスのいくつかの並べ替え。私はそれを表示するためにレイアウトに何を入力する必要があるのか​​分かりません。ダイアログに呼び出されたデータ

偉大なヘルプ。あなた

public class activity2 extends Activity { 
    /** Called when the activity is first created. */ 

    Dialog Dialog; 
    public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.main2); 

    Dialog = new Dialog(this); 
    Dialog.setContentView(R.layout.main3); 
    Dialog.setTitle("ProJect69"); 
    Dialog.setCancelable(true); 


    TextView btn1 =(TextView) findViewById(R.id.textView4); 

    btn1.setOnClickListener(new OnClickListener(){ 

     public void onBackpressed(){ 
     Intent intent= new Intent(activity2.this,activity2.class); 
     startActivity(intent); 
     finish(); 
     } 
     public void onClick(View v){ 
      Dialog.show(); 
     } 
    }); 

} 
} 

答えて

0
Dialog dlg; 
... 
((TextView) dlg.findViewByID(R.id.textView1)).setText("your text"); 
+0

ありがとうだから私は、レイアウト内のどこのTextViewを置くとき。このコードを入力すると、データベースからのデータがテキストビューに置き換えられます。 – chock

+0

はい。どうすればいいですか? –

+0

他人を助けることができるときに私は私のコードを掲示してくれてありがとう – chock

関連する問題