Gilberto Ibarra
Gilberto Ibarra

Reputation: 2927

How can i create a New Activity from IntelliJ?

How can i create a new Activity from IntelliJ for Android PRoject, and this automatically generates xml File and .Class

This is an image from my IntelliJ

Upvotes: 10

Views: 6757

Answers (3)

Joshua King
Joshua King

Reputation: 23

On OSX you can hit control + n (^N) to come up with the same options!

Upvotes: 0

Eric H.
Eric H.

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.

enter image description here

Upvotes: 21

prijupaul
prijupaul

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

Related Questions