2010年4月22日木曜日

onCreatetって?

Activity starts
        v
    onCreate()
        v
    onStart()
        v
    onResume()
        v
Activity running
        v
    onFreeze()
        v
    onPause()
        v
    onStop()
        v
    onDestroy()
        v
Activity is shut down
::::::::::
Called when the activity is starting. This is where most initialization 
should go: calling setContentView(int) to inflate the activity's UI, 
using findViewById(int) to programmatically interact with widgets in the 
UI, calling managedQuery(ContentURI, String[], String, String[], String) 
to retrieve cursors for data being displayed, etc. 

You can call finish() from within this function, in which case onDestroy() 
will be immediately called without any of the rest of the activity 
lifecycle (onStart(), onResume(), onPause(), etc) executing. 

Derived classes must call through to the super class's implementation of 
this method. If they do not, an exception will be thrown.

Parameters:
  icicle  If the activity is being re-initialized after previous being 
    shut down then this Bundle contains the data it most recently 
    supplied in onFreeze(). Note: Otherwise it is null.
 

豊富な学校情報で

あなたのなりたいに

応えます☆

なるにはサイト

Android ボタン表示アプリ

package jp.allabout.android;

import android.app.Activity;
import android.os.Bundle;

import android.app.Activity;
import android.os.Bundle;
import android.widget.Button;
import android.view.ViewGroup.LayoutParams;

public class MyAndy extends Activity
{
    /** Called with the activity is first created. */
    @Override
    public void onCreate(Bundle icicle)
    {
        super.onCreate(icicle);

        Button button = new Button(this);
        button.setText("Button");
        setContentView(button, new LayoutParams(LayoutParams.WRAP_CONTENT,
          LayoutParams.WRAP_CONTENT));
    }
}


Java superって?

http://www.javaroad.jp/java_class11.htmらしいよ