zoukankan      html  css  js  c++  java
  • 是否第一次登陆,判断引导页(不是第一次登陆,则越过引导页面)

    新手笔记,仅供参考!

    首先定义三个页面

    随后写3个activity定义功能

    package com.example.administrator.mypagelead;

    import android.content.Context;
    import android.content.Intent;
    import android.content.SharedPreferences;
    import android.os.Bundle;
    import android.support.v7.app.AppCompatActivity;
    import android.view.View;

    public class MainActivity extends AppCompatActivity {

        private SharedPreferences sharedPreferences;
        private SharedPreferences.Editor editor;
        // 判断是否是首次登陆
        private boolean isFirst;
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);

            sharedPreferences=getSharedPreferences("phone", Context.MODE_PRIVATE);
            editor=sharedPreferences.edit();
            isFirst=sharedPreferences.getBoolean("frist",true);

        }
        //欢迎页按钮
        public void huanyingye(View v){
            if(isFirst==true){//第一次登陆
                editor.putBoolean("frist",false);
                editor.commit();
                //跳转到
                Intent intent=new Intent(this,Main2Activity.class);
                startActivity(intent);
            }else {
                // 跳转到
                Intent intent=new Intent(this,Main3Activity.class);
                startActivity(intent);
            }
        }
    }
    ---------2-------

    3.

  • 相关阅读:
    DNS 查询长度
    WebSocket
    Overview of cookie persistence
    Linux Cluster
    keepalived + nginx 主主模式
    MIME 类型
    IaaS,PaaS,SaaS 的区别
    Linux下"负载均衡+高可用"集群的考虑点 以及 高可用方案说明(Keepalive/Heartbeat)
    交换机链路聚合与Linux的bond模式对照
    DHCP 中继
  • 原文地址:https://www.cnblogs.com/ll-ouyang/p/6281728.html
Copyright © 2011-2022 走看看