问题
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
, thenjava
. - 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