- private void showTCPInput() {
-
- LayoutInflater layoutInflater = LayoutInflater.from(mContext);
- View inputView = layoutInflater.inflate(R.layout.tcp_input, null);
- AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(mActivity);
- alertDialogBuilder.setView(inputView);
-
- final EditText editText = (EditText) inputView.getRootView().findViewById(R.id.ipText);
- editText.setText(Common.TCP_ADDRESS);
- alertDialogBuilder
- .setCancelable(false)
- .setPositiveButton("OK", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- if (editText.getText().length() != 0) {
- Common.TCP_ADDRESS = editText.getText().toString();
-
- StringBuilder sb = new StringBuilder();
- sb.append(Common.COAP_TCP);
- sb.append(Common.TCP_ADDRESS);
- sb.append(Common.TCP_PORT);
- makeTCPResource(sb.toString());
- }
- }
- })
- .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- dialog.cancel();
- }
- });
-
- AlertDialog alert = alertDialogBuilder.create();
- alert.show();
- }
-