当前位置:网站首页>Activity lifecycle
Activity lifecycle
2022-06-25 01:05:00 【I am at odds with C】
<?xml version="1.0" encoding="utf-8" ?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="xieting" android:onClick="tiaozhuang"/> </RelativeLayout> java package com.commerce.mylifeactivity; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Toast; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); System.out.println("onCreate() xieting"); } @Override protected void onResume() { super.onResume(); System.out.println("onResume()xieting"); } @Override protected void onStop() { super.onStop(); System.out.println("onResume()xieting"); } @Override protected void onPause() { super.onPause(); System.out.println("onResume()xieting"); } public void tiaozhuang(View view) { Intent intent=new Intent(MainActivity.this,MainActivity2.class); startActivity(intent); finish(); } @Override protected void onDestroy() { super.onDestroy(); System.out.println("onResume()xieting"); } @Override protected void onStart() { super.onStart(); System.out.println("onResume()xieting"); } } xml2 <?xml version="1.0" encoding="utf-8" ?><RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity2"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="31" android:onClick="tiaozhuangdao"/> </RelativeLayout> java package com.commerce.mylifeactivity; import androidx.appcompat.app.AppCompatActivity; import android.content.Intent; import android.os.Bundle; import android.view.View; public class MainActivity2 extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main2); } public void tiaozhuangdao(View view) { Intent intent=new Intent(MainActivity2.this,MainActivity.class); startActivity(intent); } }
边栏推荐
- ros(25):rqt_image_view报错Unable to load plugin for transport ‘compressed‘, error string
- ContentResolver,拿到手机短信内容
- QT electronic clock
- Realization of MNIST handwritten numeral recognition
- 2022 simulated 100 questions of safety officer-c certificate examination and online simulated examination
- Text editor of QT project practice ---------- episode 8
- Use of file class filenamefilter & filefilter in io
- [redis realizes seckill service ④] one order for one person, and cannot be purchased repeatedly
- 2021-02-15
- Première application de l'informatique quantique à la modélisation des flux de puissance dans les systèmes énergétiques à l'Université technique danoise
猜你喜欢

Text editor for QT project practice -- Episode 9

Activity startup process

Punch smart spirit 1. The brand is attractive. What is the strength of the product?

2022r1 quick opening pressure vessel operation test questions and answers

打卡smart精灵#1,品牌不缺吸引力,产品本身实力如何?

Scala IO read by character

Xcode预览(Preview)显示List视图内容的一个Bug及解决
最新QQ微信域名防红PHP程序源码+强制跳转打开

Using tcp/udp tools to debug the yeelight ribbon

2022 crane driver (limited to bridge crane) examination question bank simulated examination platform operation
随机推荐
Golang示例续期锁:Redis+Channel+sync.Mutex
If the order has not been paid for 30 minutes, it will be automatically cancelled. How can I achieve this?
108页(4万字)未来公寓智能化设计平台项目方案建议书2022版
Mobile security tool jarsigner
智能合约安全审计入门篇 —— delegatecall (2)
LLVM TargetPassConfig
网上开户选哪个证券公司?网上开户安全么?
改造一下 BeanUtils,优雅的实现 List 数据拷贝
Network request -volley
Leetcode 1248. 统计「优美子数组」(害,突然发现只会暴力枚举了)
Tiktok wallpaper applet v1.0.2 function, new arrival function
【无标题】
Databinding quick start (still using findviewbyid?)
Punch smart spirit 1. The brand is attractive. What is the strength of the product?
[redis realizes seckill service ②] solution to oversold problem
Text editor of QT project practice ---------- episode 11
傳輸層 以字節為單比特的滑動窗口技術
The interview questions and answers for the high-frequency software test of Dachang help you prepare for the golden nine silver ten
ros(25):rqt_image_view报错Unable to load plugin for transport ‘compressed‘, error string
腾讯云国际云服务器网络访问丢包问题解决办法