酷!學園

技術討論區 => 程式討論版 => Java程式設計討論區 => 主題作者是: vup0649 於 2010-12-21 23:53

主題: Android Intent問題
作者: vup06492010-12-21 23:53
做2個頁面互相傳送訊息在第2個頁面,當中的old1怎麼不能記錄之前的訊息 ???

代碼: [選擇]
Bundle extras = getIntent().getExtras();
          if (extras != null) {
               TextView textView2 = (TextView)findViewById(R.id.view2);
  CharSequence old1 = textView2.getText();
  textView2.setText(""+old1+extras.getCharSequence("TEXT2")+extras.getCharSequence("TEXT")+"\n");
          }