首页 > 代码库 > [android]切换activity闪屏问题

[android]切换activity闪屏问题

游戏登陆切换activity时,总是出现闪屏现象,解决方案,暂停线程100毫秒调用startActivity,闪屏解决,代码:

@Override

public void startActivity(final Intent intent) {

 

new Thread() {

 

@SuppressWarnings("static-access")

public void run() {

 

try {

 

Thread.currentThread().sleep(100);

 

} catch (InterruptedException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

 

myStartActivity(intent);

};

}.start();

}

 

public void myStartActivity(Intent intent) {

 

super.startActivity(intent);

}