0

私は Android プログラミングの初心者です。今日は SMS 送信プログラムを作成しています。このようなプログラム:

pict1

[送信] ボタンをクリックすると、結果は上記のように表示されます。

pictw

しかし、次のように、送信ボタンの下に結果を表示してもよろしいですか? pictw

フロントページのJavaコードは次のとおりです。

public class sms extends Activity {

Button sendButton;
EditText phoneTextField;
EditText msgTextField;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) 
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.smslay);        

    msgTextField = (EditText) findViewById(R.id.msgTextField);
    sendButton = (Button) findViewById(R.id.sendButton);
    phoneTextField = (EditText) findViewById(R.id.phoneTextField);

}
4

2 に答える 2

0

下のテキストビューを 1 つ取り、ボタンを送信します。結果が得られたら、テキストをそのテキストビューに設定するだけです。ユーザーがもう一度送信ボタンをクリックすると、そのテキストが空の文字列に設定されます。

于 2013-10-08T06:34:42.103 に答える
0

It sounds like you want a toast message http://developer.android.com/guide/topics/ui/notifiers/toasts.html Instead of edittext or vise versa

于 2013-10-08T08:10:43.927 に答える