Intent and start activity from string

后端 未结 5 1314
Happy的楠姐
Happy的楠姐 2021-01-05 15:36

I have a little problem. I want to start activity but in something other way. I know that

Intent i = new Intent(this, ActivityTwo.class); 

5条回答
  •  不知归路
    2021-01-05 15:52


    Class c =Class.forName("YOUR STRING" );
    Intent intent = new Intent(FirstActivity.this, c);
    startActivity(intent);
    

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题