Starting an Activity with Intent and SetClassName

前端 未结 2 1271
太阳男子
太阳男子 2021-01-25 01:13

I am using the following code to move to another Activity :

Intent intent = new Intent();  
String test = \"Navigate\";  
intent.setClassName(this.context,test         


        
2条回答
  •  滥情空心
    2021-01-25 01:18

    You need the full classname, including the package:

    String test = "your.package.here.Navigate";
    

    (And the Activity defined in the Manifest, but as you can start it with Navigate.class I assume you have already done this).

提交回复
热议问题