摘要: @Override是伪代码,表示重写(当然不写也可以)建议写上,有如下好处:1、可以当注释用,方便阅读;2、编译器可以给你验证@Override下面的方法名是否是你父类中所有的,如果没有则报错,比如你如果没写@Override而你下面的方法名又写错了,这时你的编译器是可以通过的(它以为这个方法是你的 阅读全文
posted @ 2016-02-16 13:02 KBLW 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 在主程序中 调用activity2的方法改为startActivityForResult(intent,0) 0代表下一个Activity要返回值的依据,可指定为自行定义的参考标示符。程序重写onactivityresult()这个方法,使程序在收到result后,重写加载写回原先输入的值。(在AS 阅读全文
posted @ 2016-02-16 13:01 KBLW 阅读(432) 评论(0) 推荐(0) 编辑
摘要: 在antivity1中 运用intent及bundle对象,切换activity以及传递数据 Button button01 = (Button) findViewById(R.id.button1); button01.setOnClickListener(new Button.OnClickLi 阅读全文
posted @ 2016-02-16 11:39 KBLW 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 简单的button事件 public class TestMain extends ActionBarActivity { private Button mButton01; private TextView mTextView01; @Override protected void onCreat 阅读全文
posted @ 2016-02-10 23:42 KBLW 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 在xml中知道style属性 <TextView style="@style/DavidStyleText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/myTe 阅读全文
posted @ 2016-02-10 00:08 KBLW 阅读(373) 评论(0) 推荐(0) 编辑
摘要: import android.content.res.Resources; import android.graphics.Color; import android.graphics.drawable.Drawable; import android.os.Bundle; import andro 阅读全文
posted @ 2016-02-09 23:40 KBLW 阅读(317) 评论(0) 推荐(0) 编辑
摘要: onCreate方法中利用findViewById函数查找TextView对象 mTextView01 =(TextView) findViewById(R.id.myTextView01); String str_2 = "welcome android's world";mTextView01. 阅读全文
posted @ 2016-02-04 01:15 KBLW 阅读(15212) 评论(0) 推荐(0) 编辑
摘要: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button b1 = (Button) 阅读全文
posted @ 2016-02-03 00:41 KBLW 阅读(155) 评论(0) 推荐(0) 编辑
摘要: error1:Could not find Nexus_S_API_14.ini file in $ANDROID_AVD_HOME nor in $HOME/.android/avd.android目录配置问题 在环境变量新建android_avd_home:变量值为.android目录error 阅读全文
posted @ 2016-01-30 23:05 KBLW 阅读(140) 评论(0) 推荐(0) 编辑