How can i create a new Activity from IntelliJ for Android PRoject, and this automatically generates xml File and .Class
Create a project from existing sources Launch IntelliJ IDEA. If the Welcome screen opens, press Ctrl+Shift+A , type project from existing sources , and click the Import project from existing sources action in the popup. Otherwise, from the main menu, select File | New | Project from Existing Sources.
Step 1: Firstly, click on app > res > layout > Right Click on layout. After that Select New > Activity and choose your Activity as per requirement. Here we choose Blank Activity as shown in figure below. Step 2: After that Customize the Activity in Android Studio.
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
.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With