[android]切换activity闪屏问题

时间:2023-01-13 17:43:27

游戏登陆切换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);

}