2012年10月31日
摘要: Service的启动有两种方式:context.startService() 和 context.bindService()。startService();调用者和服务之间没有联系,即使调用者退出了,服务仍然进行启动一个Service的过程如下:context.startService() ->onCreate()- >onStart()->Service running其中onCreate()可以进行一些服务的初始化工作,onStart()则启动服务。停止一个Service的过程如下:context.stopService() | ->onDestroy() -> 阅读全文
posted @ 2012-10-31 18:32 游鱼 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 1.测试类继承AndroidTestCase2.在文件Manifest.xml中加 <uses-library android:name="android.test.runner"/> 这个节点与activity同级, <instrumentation android:name="android.test.InstrumentationTestRunner" android:targetPackage="com.zjr.android.test" android:label="test" > 阅读全文
posted @ 2012-10-31 18:12 游鱼 阅读(213) 评论(0) 推荐(0) 编辑
  2012年10月30日
摘要: 相对布局 RelativeLayout 允许子元素指定它们相对于其父元素或兄弟元素的位置RelativeLayout的一些属性:第一类:属性值为true或falseandroid:layout_centerHrizontal 水平居中android:layout_centerVertical 垂直居中android:layout_centerInparent 相对于父元素完全居中android:layout_alignParentBottom 贴紧父元素的下边缘android:layout_alignParentLeft 贴紧父元素的左边缘android:layout_alignParentR 阅读全文
posted @ 2012-10-30 11:54 游鱼 阅读(224) 评论(0) 推荐(0) 编辑
  2012年10月18日
摘要: Activity生命周期见图:Table 1.A summary of the activity lifecycle's callback methods.MethodDescriptionKillable after?NextonCreate()Called when the activity is first created. This is where you should do all of your normal static set up — create views, bind data to lists, and so on. This method is passed 阅读全文
posted @ 2012-10-18 19:25 游鱼 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 1.打电话:1 Intent intent = new Intent();2 intent.setAction(Intent.ACTION_CALL);3 intent.setData(Uri.parse("tel:159xxxxxxxx"));4 startActivity(intent);必须在AndroidManifest.xml中添加权限:<uses-permission android:name="android.permission.CALL_PHONE" />2.发短信:1 Intent intentsms = new Inte 阅读全文
posted @ 2012-10-18 15:22 游鱼 阅读(233) 评论(0) 推荐(0) 编辑
  2012年10月17日
摘要: 1.创建Button, 1 <Button 2 android:id="@+id/btn1" 3 android:layout_width="wrap_content" 4 android:layout_height="wrap_content" 5 android:text="btn1" 6 /> 7 <Button 8 android:id="@+id/btn2" 9 android:layout_width="wrap_content"10 andro 阅读全文
posted @ 2012-10-17 21:08 游鱼 阅读(262) 评论(0) 推荐(0) 编辑
摘要: 只要介绍常用相关几个东东1.默认是多行,单行文本 android:singleLine="true"2.默认字符,android:hint="宝川"3.图标显示,android:drawableLeft="@drawable/sina"4.圆角,通过一个shape.xml文件设置5.长度控制,android:maxLength="5"6.输入控制,android:inputType=""这个里有多种选择,可以根据具体选择自己要的选项效果如下: 1 <?xml version="1 阅读全文
posted @ 2012-10-17 17:54 游鱼 阅读(226) 评论(0) 推荐(0) 编辑
  2012年10月16日
摘要: android TextView一些设置 阅读全文
posted @ 2012-10-16 21:02 游鱼 阅读(256) 评论(0) 推荐(0) 编辑
摘要: go eclipse 开发环境 阅读全文
posted @ 2012-10-16 20:10 游鱼 阅读(2772) 评论(0) 推荐(0) 编辑
  2012年10月15日
摘要: 下载解压:设置环境变量:vim .profile运行设置VIM环境,查看在go目录下misc/vim/readme.txt1 mkdir -p $HOME/.vim/ftdetect2 mkdir -p $HOME/.vim/syntax3 mkdir -p $HOME/.vim/autoload/go4 ln -s $GOROOT/misc/vim/ftdetect/gofiletype.vim $HOME/.vim/ftdetect/5 ln -s $GOROOT/misc/vim/syntax/go.vim $HOME/.vim/syntax6 ln -s $GOROOT/misc/vi 阅读全文
posted @ 2012-10-15 17:55 游鱼 阅读(949) 评论(0) 推荐(0) 编辑