1 Activity 官方解释为 “An Activity is an application component that provides a screen with which users can interact in order to do something, such as dial the phone, take a photo, send an email, or view a map. Each activity is given a window in which to draw its user interface. ”也就是用户用来交互的每一个窗口,用户当前正在进行的一个操作。
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, etc. This method also provides you with a Bundle containing the activity's previously frozen state, if there was one.
Always followed by onStart().
//当activity第一次被创建的时候调用。你应该在这个方法里进行所有的静态创建,创建views,(通过setContnetView方法)向lists绑定数据等等。如果存在保存的状态的话,该方法也提供给你一个包含activity最近状态的一个bundle。onStart方法总是在此方法之后调用
onRestart() 次状态下activity不可被终结
Called after your activity has been stopped, prior to it being started again.
Always followed by onStart()
//在你的activity停止后被调用,在重新开始之前调用
onResume() 次状态下activity不可被终结
Called when the activity will start interacting with the user. At this point your activity is at the top of the activity stack, with user input going to it.
Always followed by onPause().
//当activity将被启动与用户交互的时候被调用。此刻你的activity处于activity栈的顶端,用于用户输入,永远///在onPause之后被调用
Called when the system is about to start resuming a previous activity. This is typically used to commit unsaved changes to persistent data, stop animations and other things that may be consuming CPU, etc. Implementations of this method must be very quick because the next activity will not be resumed until this method returns.
Followed by either onResume() if the activity returns back to the front, or onStop() if it becomes invisible to the user.
//当系统即将重新开始以前的activity的时候被调用(不懂,自己的理解是:当当前activity要启动新的activity的时候被调用),典型的应用是用来将还未保存的数据提交到当前的数据,(意思就是保存数据更新),停止animations和其他可能耗费CPU的操作。对此方法的实现必须快速因为下个activity直到此方法返回才会被重新开始。 当activity从back(翻译后台不合适)转到front(与用户交互的状态)的时候,onResume方法会在onPause方法之后被调用 当activity变为不可见的时候,onStop方法会在onPause之后被调用
onStop() 次状态下activity可以被终结
Called when the activity is no longer visible to the user, because another activity has been resumed and is covering this one. This may happen either because a new activity is being started, an existing one is being brought in front of this one, or this one is being destroyed.
Followed by either onRestart() if this activity is coming back to interact with the user, or onDestroy() if this activity is going away.
//当activity对用户不再可见时被调用,因为另一个activity已经重新开始并且覆盖了当前activity(在栈中)。当有新的activity被启动,或者一个存在的activity重新回到前台状态,又或者当前的activity将被销毁。如果activity要返回前台和用户进行交互则在此方法后调用onReatart方法,如果当前activity要消亡,则onDestroy方法将在此方法后被调用
onDestroy() 次状态下activity可以被终结
The final call you receive before your activity is destroyed. This can happen either because the activity is finishing (someone called finish() on it, or because the system is temporarily destroying this instance of the activity to save space. You can distinguish between these two scenarios with the isFinishing() method.
最近受我的朋友委托用js+HTML做一个像手册一样的程序,里面要有可展开的大纲,模糊查找等功能。我这个人说实在的懒,本来是不愿意的,但想起了父亲以前教我要给朋友搞好关系,再加上这也可以巩固自己的js技术,于是就开始开发这个程序,没想到却出了点小问题,我做的查找只能绝对查找。具体的js代码如下:
function search(){
var arr=new Array("my
实例:
CREATE OR REPLACE PROCEDURE test_Exception
(
ParameterA IN varchar2,
ParameterB IN varchar2,
ErrorCode OUT varchar2 --返回值,错误编码
)
AS
/*以下是一些变量的定义*/
V1 NUMBER;
V2 nvarc
Spark Streaming简介
NetworkWordCount代码
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
代码示例:
# include <stdio.h>
//冒泡排序
void sort(int * a, int len)
{
int i, j, t;
for (i=0; i<len-1; i++)
{
for (j=0; j<len-1-i; j++)
{
if (a[j] > a[j+1]) // >表示升序
nginx日志分割 for linux 默认情况下,nginx是不分割访问日志的,久而久之,网站的日志文件将会越来越大,占用空间不说,如果有问题要查看网站的日志的话,庞大的文件也将很难打开,于是便有了下面的脚本 使用方法,先将以下脚本保存为 cutlog.sh,放在/root 目录下,然后给予此脚本执行的权限
复制代码代码如下:
chmo
http://bukhantsov.org/2011/08/how-to-determine-businessobjects-service-pack-and-fix-pack/
The table below is helpful. Reference
BOE XI 3.x
12.0.0.
y BOE XI 3.0 12.0.
x.
y BO
大家都知道吧,这很坑,尤其是用惯了mysql里的自增字段设置,结果oracle里面没有的。oh,no 我用的是12c版本的,它有一个新特性,可以这样设置自增序列,在创建表是,把id设置为自增序列
create table t
(
id number generated by default as identity (start with 1 increment b