0

当有人按下按钮时,我正在从我的应用程序的第一个屏幕开始一个新活动。

出于某种原因,当我尝试启动 StoryBoard 时,似乎 MainScreen 正在重新加载。

我的应用程序中的第一个活动称为 MainScreen。我正在尝试启动 StoryBoard,我做得对吗?

Intent myIntent = new Intent(MainScreen.this, StoryBoard.class);
        myIntent.putExtra("sportName", sportName);
        myIntent.putExtra("stories", storiesAsArray);
        myIntent.setClass(this, StoryBoard.class);
                startActivity(myIntent);
4

1 回答 1

1

尝试

Intent myIntent = new Intent(MainScreen.this, StoryBoard.class);
myIntent.putExtra("sportName", sportName);
myIntent.putExtra("stories", storiesAsArray);
MainScreen.this.startActivity(myIntent);
于 2012-04-23T23:14:47.460 回答