Cannot find MainActivity.java in Android Studio [closed]

孤人 提交于 2021-01-27 14:44:25

问题


I am currently writing an Android App using Android Studio 1.2. However, i cannot find MainActivity.java file in it.

Hope someone can help me out.

Thanks in advance.

Regards, Al


回答1:


Its not necessary that your file is named MainActivity.java. That is the default name. If you created the Java file with another name while making the project then that will be your main Activity file. It will have the name you gave while making the project.

Otherwise just create a new activity and enter its name in the Manifest file to make it the main activity.




回答2:


I have Android Studio 1.2 too. In the left side:

  • Choose 1: Project if it isn´t already open.
  • Then choose app, then java.
  • Then choose com.username.project.
  • Finally choose MainActivity.java.



回答3:


When you create new project select Blank Activity. MainActivity file is in Android -> app -> java -> your.package.name




回答4:


Inside of android folder navigate to

app --> src --> java --> com --> "your app name"



来源:https://stackoverflow.com/questions/30016492/cannot-find-mainactivity-java-in-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!