package com.slide;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
public class SlideTestActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
public void ButtonOnClick(View v){
Intent subactivity = new Intent(this,com.slide.SubActivity.class);
startActivityForResult(subactivity, R.id.button1);
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_left);
}
}
サブ画面のActivityファイル
package com.slide;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
public class SubActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.sub);
}
public void ButtonOnClick(View v){
Intent subactivity = new Intent(this,com.slide.SlideTestActivity.class);
startActivityForResult(subactivity, R.id.button1);
overridePendingTransition(R.anim.slide_in_left,R.anim.slide_out_right);
}
}
//現在の時刻を取得
long startTime = System.currentTimeMillis();
Log.d("タグ", String.valueOf(startTime));//1321464077988と表示される
日付フォーマットで表示
//現在の時刻を取得
//現在の時刻を取得
long startTime = System.currentTimeMillis();
Date date = new Date(startTime);
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy.MM.dd.HH:mm:ss SSS");//
Log.v("タグ", simpleDateFormat.format(date));//2011.11.17.02:53:38 217