Java 使用 Eclipse 创建新的 android 项目后,Eclipse 中的 SRC 文件夹为空(未创建 MainActivity 类)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22243651/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SRC folder in Eclipse is empty (MainActivity class not created) after creating a new android project using Eclipse
提问by subin
SRC folder in Eclipse is empty (MainActivity class not created) after creating a new android project using Eclipse-
使用 Eclipse 创建新的 android 项目后,Eclipse 中的 SRC 文件夹为空(未创建 MainActivity 类)-
I created a new android project using Eclipse. But I am seeing SRC folder is empty in the project explorer. But as per my understanding it should create few .java files automatically like MainActivity.java.
我使用 Eclipse 创建了一个新的 android 项目。但是我在项目资源管理器中看到 SRC 文件夹是空的。但根据我的理解,它应该像 MainActivity.java 一样自动创建几个 .java 文件。
回答by desidigitalnomad
After entering the Application Name, Project name, etc in the New Android Applicationwindow, the next window shown is this :
在New Android Application窗口中输入应用程序名称、项目名称等后,显示的下一个窗口是这样的:
Make sure you check the Create Activitycheckbox, otherwise the activity will not be created by default.
确保选中创建活动复选框,否则默认情况下不会创建活动。
You still can create an activity by right-clicking on the project and New > Other > Android > Android Activity. But you have to make sure you check the Launcher Activitycheckbox in case it is the first activity of your application
您仍然可以通过右键单击项目和 New > Other > Android > Android Activity 来创建活动。但是您必须确保选中Launcher Activity复选框,以防它是您应用程序的第一个活动
回答by Suraj Dubey
Go to following:
'Help'->'Install New Software'and type
https://dl-ssl.google.com/android/eclipse/
转到以下内容:
“帮助”->“安装新软件”并输入
https://dl-ssl.google.com/android/eclipse/
Select ADT option and install it. It will update the ADT.
选择 ADT 选项并安装它。它将更新 ADT。
Even I had the same problem and my issue got resolved with it!!
即使我遇到了同样的问题,我的问题也得到了解决!!
回答by Scumble373
I had this problem for the longest time. When creating the android application, use "empty activity" instead of "blank" activity. Fixed the problem for me immediately.
我有这个问题最长的时间。创建 android 应用程序时,使用“空活动”而不是“空白”活动。立即为我解决了问题。
Hope this helps :)
希望这可以帮助 :)
回答by BRap
I hope this helps someone :)
我希望这可以帮助别人 :)
I had the same 'error' and it appears to me if when creating the app I use in the 'application name' non ASCII characters !
我有同样的“错误”,在我看来,如果在创建应用程序时我在“应用程序名称”非 ASCII 字符中使用!
Example: ?????...
例子: ?????...
So do NOT USE ????? in Application Name !!!
所以不要使用????在应用程序名称中!!!
and yes I know it's not good practice to use them in programing :D
and yes I know it's not good practice to use them in programing :D