android 启动页面的设置
来源:互联网 发布:maya动漫软件 编辑:程序博客网 时间:2024/06/16 00:08
展示启动界面,可自定义,其中R.layout.login可以放一张图片
StartActivity.java
package com.example.usinglistview;/** * @projectname UsingListView * @author Jo Jo_feng * @foundtime 2016-1-5 下午9:33:28 * @theme 启动界面的设置 */import android.app.Activity;import android.content.Intent;import android.content.pm.PackageInfo;import android.content.pm.PackageManager;import android.content.pm.PackageManager.NameNotFoundException;import android.graphics.PixelFormat;import android.os.Bundle;import android.os.Handler;import android.view.WindowManager;import android.widget.TextView;public class StartActivity extends Activity {@SuppressWarnings("deprecation")@Override public void onCreate(Bundle icicle) { super.onCreate(icicle); getWindow().setFormat(PixelFormat.RGBA_8888); getWindow().addFlags(WindowManager.LayoutParams.FLAG_DITHER); setContentView(R.layout.activity_start); //Display the current version number PackageManager pm = getPackageManager(); try { PackageInfo pi = pm.getPackageInfo("com.example.usinglistview", 0);//设置程序版本 TextView versionNumber = (TextView) findViewById(R.id.textView1); versionNumber.setText("Version 版本 " + pi.versionName);//在启动页面显示文本 } catch (NameNotFoundException e) { e.printStackTrace(); } new Handler().postDelayed(new Runnable() { public void run() { /* Create an Intent that will start the Main WordPress Activity. */ Intent mainIntent = new Intent(StartActivity.this, MainActivity.class); StartActivity.this.startActivity(mainIntent); StartActivity.this.finish(); } }, 2900); //2900 for release } }
activity_start.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" android:background="@drawable/ic_launcher" tools:context=".StartActivity" > <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="69dp" android:text="TextView" /></RelativeLayout>
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.usinglistview" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="18" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.example.usinglistview.MainActivity" android:label="@string/app_name" > </activity> <activity android:name="com.example.usinglistview.StartActivity" android:label="@string/title_activity_start" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application></manifest>
0 0
- android 启动页面的设置
- Android启动页面设置Splash
- Android打开自启动设置页面
- ios 设置启动页面的时间
- cordova启动页面和图标的设置
- Android 设置页面的设计
- Android 设置页面的设计
- Android 设置页面的设计
- Android 设置页面的设计
- Android设置页面的设计
- 启动页面设置
- 启动页面设置
- 启动页面设置
- iOS设置启动页面
- 启动系统设置页面
- 编写Android启动页面的方法
- Android启动页面的正确打开方式
- android 启动系统的功能页面Action
- 去空格
- Android 可拖拽的GridView效果实现, 长按可拖拽和item实时交换
- mgo使用指南
- 【解决办法】使用Cocos Code IDE 导出 Android 工程「执行命令出错,返回值:2。」
- 数据库里时间有时分秒,gridcontrol里时间显示却没有时分秒
- android 启动页面的设置
- Andriod(一)--环境搭建
- 后台订单添加weight等栏目
- Tomcat去除项目名称和端口号,直接使用ip地址访问项目的方法
- Cas(03)——Cas Server中各配置文件介绍
- 性能分析与调优的原理
- OSI模型、网际网协议模型
- 酷炫动画----Twitter like(心形)动画实现及分析
- 位标识符