android按钮的操作例子,简单大家看明白_基础篇
2011-01-30 20:01
357 查看
先让我们看一下图先。 |
主代码量,很少吧。大家一下,就明白。哈哈, public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); TextView myTextView = (TextView) findViewById(R.id.myTextView); Button myButton = (Button) findViewById(R.id.myButton);// 取得按扭的内容 myTextView.setText("我的第一个TextView");// 请注意显示的时候在哪里。 myButton.setText("我的第一个Button" + "\n" + "Smart测试程序");// 按扭换行了吧。另外大家在看的时候,请注意一下 // ,main.xml文件与strings.xml写法。 }
本文出自 “技术成就梦想” 博客,请务必保留此出处http://llb988.blog.51cto.com/1940549/487629
相关文章推荐
- android按钮的操作例子,简单大家看明白_基础篇
- android中关于美化Button按钮的一些简单操作(其他控件也类似)
- Android数据库简单操作例子
- Android MVP模式简单例子实战
- Android异步任务的简单呢操作,以及运行过程。
- Android 自定义编译时注解1 - 简单的例子
- Android ButterKnife的简单例子
- android json解析及简单例子
- Android 中短信数据库的简单操作
- BGRABitmap图像操作1:最简单的例子,在窗体上画一个长方体
- android发送xml信息到web服务器简单例子
- Android的一个Relative Layout的简单例子
- android例子程序(ApiDemo)简单分类整理
- Android Wifi简单管理与操作
- Android小例子(点击一个按钮,传递数据给另一个页面)
- Android SD卡简单的文件读写操作
- 解决android 长按语音操作 弹出语音层 点击其他的按钮会影响语音层的时间
- 一个android中AIDL的简单例子
- 全选反选按钮简单例子
- android的SAX解析XML文件的简单的例子SaxXmlDemoActivity