简体   繁体   English

在Intellij Idea 10.5中设置活动类,以便在模拟器上运行Android应用

[英]Set the Activity Class in Intellij Idea 10.5 for Running Android App on Emulator

Recently I created and application under eclipse and it worked just fine later on I tried to transfer the codes to Intellij idea 10.5 and what I did is removing the Original MyActivity.java and replace it with the class I made under eclipse... Now every time I try to run my app it says that I need to define the Android Activity class and when I select that file it says that the class is not Acceptable. 最近,我创建了eclipse下的应用程序,后来我尝试将代码转移到Intellij idea 10.5,然后删除了原始MyActivity.java,并用我在eclipse下创建的类替换了它,所以效果很好。当我尝试运行我的应用程序时,它说我需要定义Android Activity类,当我选择该文件时,它说该类是不可接受的。

Since I look at the codes in the original MyActivity class and my own class everything looks similar and I didn't change the structure of an activity class... so what is the problem? 由于我查看了原始MyActivity类和我自己的类中的代码,因此所有内容看起来都很相似,而且我没有更改活动类的结构...那么问题是什么?

Did you add this activity in AndroidManifest.xml ? 您是否在AndroidManifest.xml添加了此活动? Does your class extend Activity ? 您的课程会扩展Activity吗?

If the class meets the above requirements, you will be able to specify it in Android Run/Debug configuration. 如果该类满足上述要求,则可以在Android Run / Debug配置中指定它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM