在我的 Android 应用程序中,我有 4 个 EditText,用户在其中放置他的信息
而且我想创建另一个 EditText,其中 4 EditText 中的所有信息都被连接起来......但我真的不想这样做......
这是我的代码:
private Editable mtext1 = null;
private Editable mtext2 = null;
private Editable mtext3 = null;
private Editable mtext4 = null;
EditText mtext5;
PendingIntent mNfcPendingIntent;
IntentFilter[] mWriteTagFilters;
IntentFilter[] mNdefExchangeFilters;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mNfcAdapter = NfcAdapter.getDefaultAdapter(this);
setContentView(R.layout.main);
findViewById(R.id.write_tag).setOnClickListener(mTagWriter);
//final Button quitBut = (Button) findViewById(R.id.button1);
mNoteBarCode = ((EditText) findViewById(R.id.noteBareCode));
mNoteAirport = ((EditText) findViewById(R.id.noteAirport));
mNoteFlightNumber = ((EditText) findViewById(R.id.noteFlightNumber));
mNoteName = ((EditText) findViewById(R.id.noteName));
mNote = ((EditText) findViewById(R.id.noteFull));
mtext1 = mNoteBarCode.getText();
mtext2 = mNoteAirport.getText();
mtext3 = mNoteFlightNumber.getText();
mtext4 = mNoteName.getText();
mtext5 = (EditText) mtext1 + (EditText) mtext2 + .......; // doesn't work
mtext5 = (EditText) mNote.getText();