1.MainActivity里第一个方法

protected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);findViewById(R.id.Btn01).setOnClickListener(this);}

如果不加findViewById,下面会按界面上的什么按钮都没反应 2.上面的findVIewById如果后面括号只有(R.id.Btn01)则运行时只有Btn01有反应其余按钮也没反应 3.AndroidManifest.xml里,activity标签中有一个android:name="com.example.test.xxx",如果这里xxx的名字对不上号,即使编译没问题也运行不出来,会在模拟器上显示"sorry ........force close"

本文出自 “Chronosphere” 博客,转载请与作者联系!

更多相关文章

  1. android 按钮按下效果2
  2. Android按钮样式(dmytrodanylyk)使用
  3. 自定义按钮实现android 返回按钮 事件
  4. android延迟进入主界面和点击按钮进入主界面代码
  5. Android ActionBar中的按钮添加旋转动画
  6. Android studio 点击按钮跳转到新的Activity
  7. Android中ImageButton自定义按钮的按下效果的代码实现方法,附网上
  8. android 按钮倒计时读秒
  9. 改变button按钮的形状

随机推荐

  1. android Button组件的属性和方法
  2. Android(安卓)中 Log 机制详解
  3. android textview 自动链接网址 修改默认
  4. android RatingBar自定义图片
  5. Android(安卓)Studio 配置SVN报错解决
  6. egret 打包android app 时 js 错误
  7. Android调用系统摄像头拍照并剪裁压缩
  8. Android修改Gallery页面布局
  9. Android开发之与服务器(jsp)发送、接受JSON
  10. 【Android(安卓)系统开发】 Android(安卓