@SuppressWarnings("deprecation")
public void onConnectButtonClicked(View v)
{
showDialog(1);
}
private Dialog buildDialog3(Context context)
{
LayoutInflater inflater = LayoutInflater.from(this);
final View textEntryView = inflater.inflate(R.layout.text_entry, null);
EntryIP_EditView = (EditText)textEntryView.findViewById(R.id.Entry_Ip_view);
EntryPort_EditView = (EditText)textEntryView.findViewById(R.id.Entry_Port_view);
AlertDialog.Builder builder = new AlertDialog.Builder(context);
builder.setIcon(R.drawable.alert_dialog_icon);
builder.setTitle("输入IP地址和端口号");
builder.setView(textEntryView);
builder.setPositiveButton("确定",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
//EntryIP_EditView.getText().toString().trim();
//target_port_number = Integer.parseInt(EntryPort_EditView.getText().toString());
setTitle("Target IP:" + targetIP );
}
});
builder.setNegativeButton("取消",
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int whichButton) {
//setTitle("您刚才点击了对话框上的取消按钮");
}
});
return builder.create();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();
if (id == R.id.action_settings) {
return true;
}
return super.onOptionsItemSelected(item);
}
}