实验
来源:互联网 发布:头影测量软件数据 编辑:程序博客网 时间:2024/04/29 04:15
package com.example.yhf;import android.app.Activity;import android.os.Bundle;import android.view.LayoutInflater;import android.view.View;import android.widget.Button;import android.widget.EditText;import android.widget.TextView;import android.widget.Toast;public class MainActivity extends Activity{private Button button;private EditText eT1;@Overrideprotected void onCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);button = (Button)findViewById(R.id.button1);eT1 = (EditText)findViewById(R.id.eT1);button.setOnClickListener(new View.OnClickListener(){@Overridepublic void onClick(View view){String name = eT1.getText().toString();View layout = LayoutInflater.from(MainActivity.this).inflate(R.layout.toast, null);Toast toast = new Toast(MainActivity.this);TextView textView = (TextView)layout.findViewById(R.id.text);textView.setText("你好 " + name);toast.setDuration(Toast.LENGTH_LONG);toast.setView(layout);toast.show();}<span style="font-family: Arial, Helvetica, sans-serif;">});</span>
}
第一次写着东东,格式啥的只能是全凭喜好了。
本段也就仅仅实现了图片中所实现的内容。其他的内容我还需充电之后才可补全。
。。。。。。
1 0
- 实验
- 实验
- 实验
- 实验
- 实验
- 实验
- 实验
- 实验
- 实验
- 实验
- 实验。。
- 实验
- 实验
- 实验
- 实验
- 实验
- 实验
- 实验
- [LeetCode] 4.Median of Two Sorted Arrays
- 题目1480:最大上升子序列和
- 我的隔天Codeforces——Round #372 (Div. 2)
- toString是如何被System.out.println调用的
- python+Eclipse+pydev环境搭建
- 实验
- 提高班—I Belonged To You
- 第三周 项目4-顺序表的应用
- Linux总结(一):文件系统基本结构
- Java Integer 小问题
- <机器学习笔记-05 ><scikit-learn 05>决策树 & 随机森林
- HDU 5879 Cure
- Presto源码分析(ScanFilterAndProjectOperator)
- Linux环境进程间通信(五): 共享内存(下)