摘要: startActivityForResult与startActivity的不同之处在于: 1、startActivity( ) 仅仅是跳转到目标页面,若是想跳回当前页面,则必须再使用一次startActivity( )。 2、startActivityForResult( ) ... 阅读全文
posted @ 2015-05-17 16:48 QQ28902581 阅读(858) 评论(0) 推荐(0) 编辑
摘要: 先定义一个Activity package com.example.work; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.Menu; import android.view.MenuItem; import androi... 阅读全文
posted @ 2015-05-17 10:29 QQ28902581 阅读(185) 评论(0) 推荐(0) 编辑
摘要: Log.v .d .i .w .e//先定义一个常量,为类名 或者类名.class.getName()//private static final String TAG = "MainAcitivity" //直接用类名//除了类名,还有显示包 名private static final Stri... 阅读全文
posted @ 2015-05-13 21:16 QQ28902581 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 一个动态添加组件的LinearLayout,其 anroid:layou_width / layout_height=”wrap_content”。这样在Java里,添加一个TextView组件,并setGravity(Gravity.CENTER)后,并不生效。 应该android:la... 阅读全文
posted @ 2015-05-13 17:26 QQ28902581 阅读(1768) 评论(0) 推荐(0) 编辑
摘要: public class Person{ private String name;//,sex; private int age; public Person(String name, int age) { super(); this.name =... 阅读全文
posted @ 2015-05-13 10:00 QQ28902581 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 1、显示行号Preferences—Editors—Text Editors 里的 show line numbers。2、更强大的代码提示Preferences—Java—Editor—Content Assist 里的 Auto activation triggers for java 里,原来... 阅读全文
posted @ 2015-05-12 01:07 QQ28902581 阅读(453) 评论(0) 推荐(0) 编辑
摘要: public class MainActivity extends Activity { private Button button; @Override protected void onCreate(Bundle savedInstanceState) { sup... 阅读全文
posted @ 2015-05-12 01:06 QQ28902581 阅读(105) 评论(0) 推荐(0) 编辑