Home > Back-end >  Android development, how to interact with display AlertDialog main activity?
Android development, how to interact with display AlertDialog main activity?

Time:03-19

I want to put the main activities of the received data in real-time display on the alertdialog, click the custom button to call the main activities in the alertdialog send data in the method, but the actual debugging found button does not respond, data don't display, how do I solve?
 alertDialog=new alertDialog. Builder (SecondActivity. This) 
SetView (R.l ayout. Dialog_window)
The create ();

LayoutInflater inflater=LayoutInflater. The from (SecondActivity. This);
The View dialogView=inflater. Inflate (R.l ayout. Dialog_window, null);

The Button sendMessage=(Button) dialogView. The findViewById (R.i d.s endMessage);
The EditText EditText=(EditText) dialogView. The findViewById (R.i d.e ditText);
responseData=https://bbs.csdn.net/topics/(TextView) dialogView. The findViewById (R.i d.r esponse_data);

SendMessage. SetOnClickListener (view - & gt; {
If (alertDialog!=null & amp; & AlertDialog. IsShowing ()) {
The e (" alertdialog ", "onCreate");
String message=editText. GetText (). The toString ();
if (! Message. The equals (" ")) {
Byte [] byteMessage=message. GetBytes ();
WriteBytes (byteMessage);
}
}
});
AlertDialog. The show ();

  • Related