• 安卓——Activity生命周期、




    1. 在xml 设计页面添加标签
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout 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="com.example.administrator.app_style.MainActivity"
        android:orientation="vertical">
    
        <Button
        android:id="@+id/b1"
        android:text="click select!"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
        <Button
            android:id="@+id/b2"
            android:text="click Dx!"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    
    </LinearLayout>
    

      2
    /**
     * Created by Administrator on 2017/1/3.
     * 四大组件都需要注册-》跳转
     */
    
    public class One extends AppCompatActivity {
    
    //    顺序
    //    正常
    //
    // On create -> 创建 Activity不可见
    // On  start -> 推出去 Activity可见
    // On resume->  用于暂停的回调Activity
    // On pause ->  暂停 Activity
    // On stop -> OnDestory 销毁Activity结束
    //↓ ↑ ← →
    //    Log →.d  debug    .e exception   .i info
    
    
        @Override
        protected void onCreate(@Nullable Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.timcopy);
            Log.e("s","onCreate ->");
        }
    
        @Override
        protected void onStart() {
            super.onStart();
            Log.e("s","onStart ->");
        }
    
        @Override
        protected void onResume() {
            super.onResume();
            Log.e("s","onResume ->");
        }
    
        @Override
        protected void onPause() {
            super.onPause();
            Log.e("s","onPause ->");
        }
    
        @Override
        protected void onStop() {
            super.onStop();
            Log.e("s","onStop() ->");
        }
    
        @Override
        protected void onDestroy() {
            super.onDestroy();
            Log.e("s","onDestroy()");
        }
      
    1. 在xml 设计页面添加标签
    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout 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="com.example.administrator.app_style.MainActivity"
        android:orientation="vertical">
    
        <Button
        android:id="@+id/b1"
        android:text="click select!"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />
        <Button
            android:id="@+id/b2"
            android:text="click Dx!"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    
    </LinearLayout>
    

      2
    /**
     * Created by Administrator on 2017/1/3.
     * 四大组件都需要注册-》跳转
     */
    
    public class One extends AppCompatActivity {
    
    //    顺序
    //    正常
    //
    // On create -> 创建 Activity不可见
    // On  start -> 推出去 Activity可见
    // On resume->  用于暂停的回调Activity
    // On pause ->  暂停 Activity
    // On stop -> OnDestory 销毁Activity结束
    //↓ ↑ ← →
    //    Log →.d  debug    .e exception   .i info
    
    
        @Override
        protected void onCreate(@Nullable Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.timcopy);
            Log.e("s","onCreate ->");
        }
    
        @Override
        protected void onStart() {
            super.onStart();
            Log.e("s","onStart ->");
        }
    
        @Override
        protected void onResume() {
            super.onResume();
            Log.e("s","onResume ->");
        }
    
        @Override
        protected void onPause() {
            super.onPause();
            Log.e("s","onPause ->");
        }
    
        @Override
        protected void onStop() {
            super.onStop();
            Log.e("s","onStop() ->");
        }
    
        @Override
        protected void onDestroy() {
            super.onDestroy();
            Log.e("s","onDestroy()");
        }
      
  • 相关阅读:
    jquery点击展开-收起
    jquery-选择器
    导航-三级联动
    Apriori算法
    K近邻算法
    宝贵数据集——用于数据挖掘、机器学习、文本挖掘
    Microsoft 神经网络分析算法
    Java网络爬虫
    写Java须知CPU缓存
    MapReduce实现计数
  • 原文地址:https://www.cnblogs.com/embaobao/p/10720864.html
Copyright © 2020-2023  润新知