<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、创建新包

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 Textview颜色渐变
  2. Android启动过程的Zygote进程
  3. android Notification的使用
  4. 如何修改android开机启动默认横竖屏
  5. Android(安卓)渐变色TextView
  6. Android——Activity生命周期
  7. 启动 flutter项目时报Could not find com.android.tools.build:g
  8. Android获取、设置Wifi状态
  9. Android之Activity生命周期

随机推荐

  1. Android(安卓)适配之FileProvider的使用
  2. 深入理解 Android(安卓)的 IPC 机制-----
  3. android 模拟器 PANIC: Could not open:
  4. Android: Bluetooth profile list for 2.
  5. Android 系统操作
  6. android语音识别和语音播报相关资料总结
  7. android 使用动画 Button移动后不响应点
  8. Android_开发 Android传感器(加速度传感器
  9. 获取与修改android自带日历日程
  10. 【Android】ImageMap,图片地图