Android:第二次打开Frize启动屏幕页面

Android:第二次打开Frize启动屏幕页面,android,Android,在我的启动屏幕活动中,我使用(FCM)从通知中获取数据。当第一次打开我的应用程序时没有问题,但关闭我的应用程序,然后再次打开,然后只显示启动屏幕 if (getIntent().getExtras() != null) { for (String key : getIntent().getExtras().keySet()) { String value = getIntent().getExtras

在我的启动屏幕活动中,我使用(FCM)从通知中获取数据。当第一次打开我的应用程序时没有问题,但关闭我的应用程序,然后再次打开,然后只显示启动屏幕

if (getIntent().getExtras() != null) {
                        for (String key : getIntent().getExtras().keySet()) {
                        String value = getIntent().getExtras().getString(key);
                        if (key.equals("WOID")&& value != null) {
                            Bundle b = new Bundle();
                            b.putString("WONum", value);
                            b.putString("from", FROM_PUSH);
                            Intent intent = new Intent(this, xyz.class);
                            intent.putExtra("b", b);
                            startActivity(intent);
                            finish();
                        }
                    }
                }else {
                    Intent i = new Intent(Splash.this, DashboardActivity.class);
                    startActivity(i);
                    finish();
                }
在我只使用这行代码之后,就可以了。请给我你宝贵的分类谢谢你

                    Intent i = new Intent(Splash.this, DashboardActivity.class);
                    startActivity(i);
                    finish();

您的
getExtras
可能不是
null
,但没有
WOID
键,在这种情况下,您的应用程序将卡在
Splash
中。您还应该检查
if
for循环中的
if
语句是否至少执行过一次,如果没有,请执行与
else
语句中相同的操作。如果(getIntent().getExtras()!=null)为null,那么为什么不调用else条件呢。