我已經在使用Android Studio創建的Android應用上實現了初始屏幕,並且我想將微調器添加到初始屏幕。誰能給我一隻手在此:如何將微調器添加到Android中的splashscreen中
這裏是我的splashScreen.java類代碼:
package com.packagename.appname;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
/**
* Created by VAIO1 on 05/09/2014.
*/
public class splashScreen extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.splash);
Thread logoTimer = new Thread() {
public void run() {
try {
sleep(3000);
Intent splashIntent = new Intent("com.packagename.appname.SPLASH");
startActivity(splashIntent);
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
finish();
}
}
};
logoTimer.start();
}
@Override
protected void onPause() {
super.onPause();
}
}
這裏是我的splash.xml代碼:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:id="@+id/splashId">
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:src="@drawable/screen"
android:cropToPadding="false"
android:scaleType="fitXY"/>
</LinearLayout>
謝謝對於如何實現這一目標的任何反饋。
在splashActivity中使用spinner有什麼用? – 2014-09-06 05:15:53
爲什麼您每次啓動應用程序時都想浪費用戶三秒鐘的時間?這是愚蠢的,不必要的,並會讓你立即卸載。使用啓動屏幕*只有*如果你真的在做某事 - 比如加載數據或準備資產。 – 323go 2014-09-06 05:20:09
這是一個私人應用程序,在我的公司內部使用...所以這不是浪費時間。所以你的評論絕對沒有影響我使用持續2或3秒,期間的飛濺屏幕決定.. – xzibit 2014-09-06 05:28:10