Android课程设计第六天欢迎界面(跳转)

注意:课程设计只为完成任务,不做细节描述~

package com.example.myapplication;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.TextView;

/**
 * Created by 樱花落舞 on 2017/6/13.
 */

public class JumpActivity extends Activity {
    TextView textView;
    int time=3;
    Handler handler=new Handler();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.jump);
        textView= (TextView) findViewById(R.id.textview);

        handler.postDelayed(runnable,1000);

    }

    Runnable runnable=new Runnable() {
        @Override
        public void run() {
            time--;
            handler.postDelayed(this,1000);
            textView.setText("+"+time+"s");

            if(time==0){
                Intent intent = new Intent(JumpActivity.this,TestActivity.class);
                startActivity(intent);
                finish();
            }else {
                textView.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        Intent intent=new Intent(JumpActivity.this,TestActivity.class);
                        startActivity(intent);
                        //结束线程
                        handler.removeCallbacks(runnable);
                        finish();
                    }
                });
            }
        }
    };
}
package com.example.myapplication;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        intent.setClass(MainActivity.this,JumpActivity.class);
        startActivity(intent);
        MainActivity.this.finish();
    }
    Intent intent = new Intent();
}
package com.example.myapplication;

import android.app.Activity;
import android.os.Bundle;
import android.support.annotation.Nullable;

/**
 * Created by 樱花落舞 on 2017/6/13.
 */

public class TestActivity extends Activity {
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.empty_activity);
    }
}
<?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="com.example.myapplication.MainActivity"

    android:orientation="vertical">
    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:src="@mipmap/bg"/>
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="+3秒"
        android:id="@+id/text"
        android:textSize="20dp"
        android:layout_alignParentRight="true"/>

</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="match_parent">
   <TextView
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:background="@mipmap/a"/>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="match_parent"
    android:orientation="vertical">
    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:src="@mipmap/bg"/>
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/textview"
        android:textSize="20sp"
        android:text="+3s"
        android:layout_alignParentRight="true"/>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myapplication">

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".JumpActivity"
            android:label="@string/app_name"
        >
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".MainActivity"/>
        </activity>
        <activity android:name=".TestActivity"
            android:label="@string/app_name">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".MainActivity"/>

        </activity>
    </application>

</manifest>
时间: 2024-08-10 00:06:36

Android课程设计第六天欢迎界面(跳转)的相关文章

Android课程设计第二天界面排版

注意:课程设计只为完成任务,不做细节描述~ 老师叫我们做一个这个样子,然后.. 1 <?xml version="1.0" encoding="utf-8"?> 2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 xmlns:tools="http://schemas.android.com/tools"

java(课程设计之记事本界面部分代码公布)

代码:涉及记事本的一些界面......!! 1 /* 2 *java课程设计之记事本(coder @Gxjun) 3 * 编写一个记事本程序 4 * 要求: 5 * 用图形用户界面实现. 6 * 能实现编辑.保存.另存为.查找替换等功能. 7 * 提示:使用文件输入输出流. 8 */ 9 package project; 10 11 import javax.swing.*; 12 import java.awt.*; 13 import java.awt.event.*; //引用类设置触发事

Android课程设计第五天欢迎界面(滑动)

注意:课程设计只为完成任务,不做细节描述~ 滑动界面 1 package com.example.myapplication; 2 3 import android.content.Intent; 4 import android.os.Handler; 5 import android.os.Message; 6 import android.support.v7.app.AppCompatActivity; 7 import android.os.Bundle; 8 9 import Uti

Android课程设计——博学谷1.0

没错,又是一学期期末时,我又来补课程设计了,hhh. 总体认识 服务器端: 首先在NetBeans中打开服务器端程序: 然后打开Navicat,连接到wlw1db数据库,建立一张自己的表,再添加所要访问的用户信息: 然后再修改服务器程序中连接数据库的常用类——DBUtil中的连接方法getConn(),确保数据库连接成功. 最后运行serverlet中的ListAllUserServlet可以在浏览器中看到所有用户username和password的json串. 手机端: 首先模拟运行之前的An

Android课程设计第四天ListView运用

注意:课程设计只为完成任务,不做细节描述~ 效果图 1 <?xml version="1.0" encoding="utf-8"?> 2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 4 xmlns:tools="http://schemas.android.com/tools" 5 android:l

android课程设计问题简介

以下是从零开始一步一步幸苦摸索得来的一些经验和方法,虽然看不懂但还是坚持看坚持改,所以贵在坚持 1,第一个界面写入sp始终虚拟即出现错误,后来再lab3上面修改 lab3原来是登陆界面并把用户和密码写入sp中. 只是把写sp改为注册,并消除界面信息 loginBt.setOnClickListener(new OnClickListener(){ public void onClick(View v){ if(qqNo.getText().toString().equals("")||

Android 课程设计

基于Android平台的学生信息管理系统 1 一.系统需求分析 1 二. 系统设计 2 2.1系统模块设计 2 2.2 系统总体设计 2 2.3 系统数据库设计 2 (学生信息表) 2 (课程信息表) 2 (成绩信息表) 3 三. 系统详细设计与实现 3 3.1 主界面 3 3.2学生信息界面 5 3.3 课程信息界面 10 3.4 成绩信息界面 14 四. 系统测试 17 4.1 测试 17 4.2 测试结果 17 五. 体验心得 18 附件 Java主要源代码 19 基于Android平台的

Android中使用Intent实现界面跳转

Intent 信使.意图 由Intent来协助Android各个组件之间跳转 1. startActivity(intent) 包下新建一个类,FActivity.class public class FActivity extends AppCompatActivity {     @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceStat

Android课程设计 人脸识别签到(二)

学习完百度人脸API的调用,现在即可开发自己的人脸识别签到系统,下面作者先贴上部分功能源码来给大家参考和学习 (一)百度人脸库的人脸验证 1°   获取待识别的照片 既然是人脸认证 那么当然首先得向百度人脸库添加你的人脸 然后再把你需要进行人脸识别的照片与百度人脸库的人脸进行校对,如果校对成功,即签到打卡成功 关于获取带人脸识别的照片,作者采取了两种方式获取(即时拍照.从相册导入) 即时拍照: Camera.setOnClickListener(new View.OnClickListener(