Android应用程序的问候活动

时间:2013-07-05 19:41:34

标签: android

我喜欢在mainActity开始之前启动问候语活动的方法,例如应用程序的欢迎屏幕(徽标或图片)

3 个答案:

答案 0 :(得分:1)

您只需创建新活动,然后将此代码移至清单中,以附加到新活动中。

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

在活动中只显示您想要的图标,然后使用timer倒计时,直到您使用意图将用户带到另一个活动。

Intent i = new Intent(this, ActivityTwo.class);
startActivity(i); 

答案 1 :(得分:0)

有什么问题?只需使用问候语进行活动,然后在一段时间后启动MainActivity

答案 2 :(得分:0)

public class SplashActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);    
        Thread splash= new Thread(){
            public void run()
            {
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                finally{
                    Intent i = new Intent(getApplicationContext(),Login.class);
                    startActivity(i);
                }

            }
            };
            splash.start();

    }

正是你需要的!根据您的需要进行修改