1 Star 0 Fork 0

Kelsey_zhang / MY PROGRAM_new

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
jump_MainActivity2.java 1.56 KB
一键复制 编辑 原始数据 按行查看 历史
Kelsey_zhang 提交于 2022-10-20 10:28 . activiTy的生命周期与跳转
package com.example.my09_14application;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
public class jump_MainActivity2 extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_jump_main2);
Intent intent2=getIntent();
intent2.putExtra("age1",intent2.getStringExtra("age1")+intent2.getStringExtra("age2"));
// TextView textView;
// textView=findViewById(R.id.textView10);
// textView.setText((CharSequence) intent2);
setResult(2,intent2);
finish();
}
@Override
protected void onStart() {
super.onStart();
Log.d("zyj","这是2的onstart");
}
@Override
protected void onStop() {
super.onStop();
Log.d("zyj","这是2的onStop");
}
@Override
protected void onDestroy() {
super.onDestroy();
Log.d("zyj","这是2的onDestroy");
}
@Override
protected void onPause() {
super.onPause();
Log.d("zyj","这是2的onPause");
}
@Override
protected void onRestart() {
super.onRestart();
Log.d("zyj","这是2的onRestart");
}
@Override
public void recreate() {
super.recreate();
Log.d("zyj","这是2的recreate");
}
@Override
protected void onResume() {
super.onResume();
Log.d("zyj","这是2的onResume");
}
}
1
https://gitee.com/kelsey-zhang/my-program_new.git
git@gitee.com:kelsey-zhang/my-program_new.git
kelsey-zhang
my-program_new
MY PROGRAM_new
master

搜索帮助