<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:paddingLeft="@dimen/activity_horizontal_margin"    android:paddingRight="@dimen/activity_horizontal_margin"    android:paddingTop="@dimen/activity_vertical_margin"    android:paddingBottom="@dimen/activity_vertical_margin"    tools:context="net.oschina.app.AppStart">    <LinearLayout        android:id="@+id/app_start_view"        android:orientation="vertical"        android:layout_width="fill_parent"        android:layout_height="fill_parent"        android:gravity="bottom"        android:background="@drawable/welcome">        <TextView android:text="@string/hello_world" android:layout_width="wrap_content"            android:layout_height="wrap_content" />    </LinearLayout></RelativeLayout>

package net.oschina.app;import android.app.Activity;import android.content.Intent;import android.os.Bundle;import android.view.View;import android.view.animation.AlphaAnimation;import android.view.animation.Animation;import android.widget.LinearLayout;import net.oschina.app.ui.Main;/** * 应用程序启动类 */public class AppStart extends Activity {    @Override    protected void onCreate(Bundle savedInstanceState) {        super.onCreate(savedInstanceState);        setContentView(R.layout.activity_app_start);        final View view = View.inflate(this, R.layout.activity_app_start, null);       // LinearLayout wellcome = (LinearLayout) view.findViewById(R.id.app_start_view);        setContentView(view);        //渐变展示启动屏        AlphaAnimation aa = new AlphaAnimation(0.3f,1.0f);        aa.setDuration(2000);        view.startAnimation(aa);        aa.setAnimationListener(new Animation.AnimationListener() {            @Override            public void onAnimationEnd(Animation arg0) {                redirectTo();            }            @Override            public void onAnimationRepeat(Animation animation) {            }            @Override            public void onAnimationStart(Animation animation) {            }        });    }    /**     * 跳转到...     */    private void redirectTo(){        Intent intent = new Intent(this, Main.class);        startActivity(intent);        finish();    }}

1、创建新包

启动页面_第1张图片

2、断点调试

启动页面_第2张图片

3、Context上下文

/**
* Interface to global information about an application environment. This is
* an abstract class whose implementation is provided by
* the Android system. It
* allows access to application-specific resources and classes, as well as
* up-calls for application-level operations such as launching activities,
* broadcasting and receiving intents, etc.
*/
public abstract class Context

更多相关文章

  1. Android之十三图片2D翻转
  2. Android 编程下背景图片适配工具类
  3. android 照相以及关于自动生成的图片分辨率和面积太小问题
  4. 【OOM】Android加载大图片OOM异常解决
  5. Android 将图片文件,转成Bitmap
  6. android 根据SD卡中图片路径读取并显示SD中的图片——源代码
  7. Android Post图片和数据
  8. android 加载图片防止内存溢出

随机推荐

  1. 横屏和竖屏切换界面不刷新
  2. Android开发技术周报 Issue#72
  3. 遥控器新增键值
  4. Android 消息机制之 MessageQueue 消息队
  5. android:scaleType详解
  6. android富文本 加载带图片的html
  7. Android之RecyclerView实现时光轴
  8. Android ContentProvider实例详解
  9. Android Dependencies
  10. Android 如何配置adb环境变量