Reputation: 2927
How can i create a new Activity from IntelliJ for Android PRoject, and this automatically generates xml File and .Class
Upvotes: 10
Views: 6757
Reputation: 23
On OSX you can hit control + n (^N) to come up with the same options!
Upvotes: 0
Reputation: 7014
Choose the class from the source folder where you want to create the activity.
Right click.
Choose New
> Android Component
.
In the New Android Component Dialogue
choose Kind
> Activity
.
Name your Activity and save. You will get a Java source file created that extends Activity
and <activity android:name=".view.Sample"/>
line in the AndroidManifest.xml
.
Upvotes: 21
Reputation: 2086
From the first look, highlight the src folder and click new. currently you have highlighted the layout folder, so it might provide you only those files thats meant to go there.
You can create a java class in src folder which extends the "activity" class.
Upvotes: 1