Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
277 views
in Technique[技术] by (71.8m points)

Providing custom activity name instead of main activity in android studio while creating new project

I have just started learning to use Android Studio and using examples of login and registration codes given in various blogs.

Problem: Whenever I launch a new project, the default empty activity that gets loaded is named as MainActivity. If I change the activity name later, it leads to various build errors. I am using AndroidStudio 3.3.2.

I tried creating a project with no activity and tried adding an empty activity after the project is created. The activity got created however, when I try to run the app, I get an error Default activity not found.

How do I create a project with custom name for activity?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

actually it's very easy. you can refactor the file name and Android Studio handle the errors.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...