输入框左侧的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. 解决php中redis client进行subscribe操作出现timeout的问题

    出现该问题的原因是poll设置接收超时所致,这个超时默认设置60s 设置Redis::OPT_READ_TIMEOUT配置项: 解决方法如下: <?php $redis = new Redis( ...

  2. 【spring cloud】对接口调用者提供API使用的安全验证微服务【这里仅通过代码展示一种设计思想】【后续可以加入redis限流的功能,某段时间某个IP可以访问API几次】

    场景: 公司的微服务集群,有些API 会对外提供接口,供其他厂商进行调用.这些公开的API接口,由一个OpenAPI微服务统一提供给大家. 那么所有的调用者在调用公开API接口的时候,需要验证是否有权 ...

  3. TypeError at /post/ render_to_response() got an unexpected keyword argument 'context_instance'

    Exception Type: TypeError at /post/ Exception Value: render_to_response() got an unexpected keyword ...

  4. php 列出当前目录

    $path="."; //初使化用户所操作目录 $prevpath=dirname($path); //初使化当前脚本所在目录 $dir_handle=opendir($path) ...

  5. 左手系,右手系,row major, column major

    http://www.cnblogs.com/minggoddess/p/3672863.html dx 左手系 row major ogl 右手系 column major 差了个 matrix   ...

  6. TensorFlow笔记二:线性回归预测(Linear Regression)

    代码: import tensorflow as tf import numpy as np import xlrd import matplotlib.pyplot as plt DATA_FILE ...

  7. 使用 mybatis + flying + 双向相关建模 的电商后端

    代码地址如下:http://www.demodashi.com/demo/12468.html mybatis.flying 众所周知,mybatis 虽然易于上手,但放到互联网环境下使用时,不可避免 ...

  8. python中给程序加锁之fcntl模块的使用

    python 中给文件加锁——fcntl模块import fcntl 打开一个文件##当前目录下test文件要先存在,如果不存在会报错.或者以写的方式打开f = open('./test')对该文件加 ...

  9. android:scrollbar的一些属性

    1. activity_maim.xml <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android ...

  10. Linux学习日志--共享内存

    一:什么是共享内存             共享内存是属于IPC(Inter-Process Communication进程间通信)机制,其它两种是信号量和消息队列,该机制为进程开辟创建了特殊的地址范 ...