输入框左侧的logo:android:drawableleft

 
弹出提示:
Toast.makeText(this,"提示",Toast.LENGHT_LONG).show();
 
返回键退出:
onKeyDown(keyCode,event){
  if(keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount == 0){
//退出
return true;
}
return super.onKeyDown(keyCode,event);
}
 
注意事项:
1、测试类:继承AndroidTestCase类

方法要用test开头!!例如testCreate()、testSave()。
要在Mainfest.xml配置
在<application>内
<uses-library android:name="android.test.runner"/>
//name是默认的!
在<application>外
<instrumentation android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.ghimtim.firstapp"></instrumentation>
//name是默认的;targetPackage是MainActivty.java所在的包?
 
2、R.java不会自动生成的原因:mainfest.xml中存在错误!
 
3、新建Acivity时一定要在Mainfest.xml里面注册!!!

Android Development Note-02的更多相关文章

  1. Android Testing学习02 HelloTesting 项目建立与执行

    Android Testing学习02 HelloTesting 项目建立与执行 Android测试,分为待测试的项目和测试项目,这两个项目会生成两个独立的apk,但是内部,它们会共享同一个进程. 下 ...

  2. Android development tools line_endings hacking

    /******************************************************************** * Android development tools li ...

  3. Do's and Don'ts for Android development

    Do's and Don'ts for Android development, by Futurice developers Use Gradle and its recommended proje ...

  4. Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment:

    Administrator@DESKTOP-EHCTIOR MINGW64 /d/react-native-eyepetizer (master) $ react-native run-android ...

  5. [Android]Eclipse 安装 ADT[Android Development Tooling] 失败的两种解决办法

    原因 最近想在新装的 Win7 里搭建一下 Android 的开发环境,虽然现在有 Android Studio 了,不过还是习惯 Eclipse 一点.众所周知的原因,Eclipse 直接安装 AD ...

  6. Android Service总结02 service介绍

    Android Service总结02 service介绍 版本 版本说明 发布时间 发布人 V1.0 介绍了Service的种类,常用API,生命周期等内容. 2013-03-16 Skywang ...

  7. ADT Android Development Tools

    ADT(Android Development Tools)在Eclipse编译IDE环境中,需安装ADT(Android Developer Tools)Plug-in,这是Android在Ecli ...

  8. Solutions for common Android development problems with the Eclipse IDE- Tutorial

    Table of Contents 1. Solving typical Android development problems 1.1. Clean Project 1.2. android.co ...

  9. Android开发 Unity3D基础 Android Development

    开发环境 Window 7 Unity3D 3.3.0 MB525 defy Android 2.1-update1 本次学习: 1.认识Unity 2.Unity3D环境搭建与Android软件生成 ...

  10. Websites for more Android development information

    There is a vibrant, helpful Android developer community on the Web. Here are a numberof useful websi ...

随机推荐

  1. redis 事件

    事件是 Redis 服务器的核心,它处理两项重要的任务: 文件事件 在多个客户端中实现多路复用,接受它们发来的命令请求,并将命令的执行结果返回给客户端. 时间事件 实现服务器常规操作(server c ...

  2. retain和copy还有assign的区别

    1. 接触过C,那么假设你用malloc分配了一块内存,并且把它的地址赋值给了指针a,后来你希望指针b也共享这块内存,于是你又把a赋值给 (assign)了b.此时a和b指向同一块内存,请问当a不再需 ...

  3. ZOJ - 3228 Searching the String (AC自己主动机)

    Description Little jay really hates to deal with string. But moondy likes it very much, and she's so ...

  4. grep 精确匹配

    使用grep实现精确过滤的五种方法 (1)当被过滤的内容占据一行时 [root@MySQL scripts]# cat oldboy.log        200 0200 2000 [root@My ...

  5. java web邮件收发

    1.网上方法要导入两个包 mail.jar&activation.jar package com.zjh.shopping.util; import java.util.Date; impor ...

  6. Vue DOM事件

    本文参考自:https://mp.weixin.qq.com/s?src=3&timestamp=1527154113&ver=1&signature=tWGeTa86gyK* ...

  7. java将一个或者多个空格进行分割

    public static void main(String[] args) { String s = "GET /index.html HTTP/1.1";//字符串s由“GET ...

  8. SAS中的自动变量

    Sas自动变量:由数据步语句自动创建的. _n_ :观测序号: _error_:错误信息变量; _numeric_ :所有数值变量: _character_:所有字符变量; _all_:所有变量; f ...

  9. 面向对象程序的设计原则--Head First 设计模式笔记

    一.找出应用中可能需要变化的地方,把它们独立出来,不要和那些不需要变化的代码混在一起. 把会变化的部分取出并“封装”起来,好让其他部分不会受到影响.这样,代码变化引起的不经意后果变少,系统变得更有弹性 ...

  10. spring学习六----------Bean的配置之Aware接口

    © 版权声明:本文为博主原创文章,转载请注明出处 Aware Spring提供了一些以Aware结尾的接口,实现了Aware接口的bean在被初始化后,可以获取相应的资源 通过Aware接口,可以对S ...