开发者

Android equivalent of iPhone's default image

Is it possible to set开发者_如何学运维 a default image during starting an application? On iPhone, I can set an image named "Default.png" to do that. But is it possible on Android?

(For information I ask that because I can't use a splascreen view or auto-activity to an other, because of videoview in the first activity.)


I dont understand a reason why not to use splashscrean

public class SplashScreenActivity extends Activity {
    protected boolean _active = true;
    private Thread splashTread;
    protected int _splashTime = 2000; // time to display the splash screen in ms

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash_screen);
        // thread for displaying the SplashScreen
        final SplashScreenActivity sPlashScreen = this;
        // thread for displaying the SplashScreen
        splashTread = new Thread() {
            @Override
            public void run() {
                try {
                    synchronized (this) {
                        // wait 5 sec
                        wait(_splashTime);
                    }
                } catch (InterruptedException e) {

                } catch (UnsupportedOperationException e1) {
                    // TODO: handle exception
                } finally {
                    finish();
                    // start a new activity
                    Intent i = new Intent();
                    i.setClass(sPlashScreen, Your videoViewActivity.class);
                    startActivity(i);
                }
            }
        };
        splashTread.start();
    }

    // Function that will handle the touch
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (event.getAction() == MotionEvent.ACTION_DOWN) {
            synchronized (splashTread) {
                splashTread.notifyAll();
            }
        }
        return true;
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜