简体   繁体   English

如何更新SetContentView(Android)

[英]How to update SetContentView (Android)

I am a beginning of Android Programming, i am wring a SMS sending program today. 我是Android编程的开始,我今天正在拧SMS发送程序。 The program like this: 该程序是这样的:

pict1

After clicking the Sent button, The results will shown like above: 单击“发送”按钮后,结果将如上所示:

皮克特

But may I shown the results below the send button, like the following one ? 但是我可以在发送按钮下方显示结果,如以下所示吗? 皮克特

Here is the java code of front page : 这是首页的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);

}

Just take one textview below to send button. 只需在下面进行一个textview发送按钮即可。 After you got result just set text to that textview. 得到结果后,只需将文本设置为该textview。 When user will again click on send button set that text to empty string. 当用户再次单击发送按钮时,将该文本设置为空字符串。

听起来您好像想要敬酒消息http://developer.android.com/guide/topics/ui/notifiers/toasts.html而不是edittext,反之亦然

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM