Unable to create a new activity in Android Studio

183 views Asked by At

I am working on a demo project for my Pluralsight training course, and am trying to do something as simple as adding a new activity through Android Studio UI. I right-click on the main folder under "Java" folder (normal android folder structure) and choose 'activity'...'navigation drawer activity'. I go through all the wizard steps, and the new entry gets made in the AndroidManifest.xml file. Yet, the UI resource xml file doesn't get created and kotlin .kt file doesn't get created, either. I have a Windows 10 machine and a Kubuntu 20.04 machine and have gotten this same behavior on both.

Here are the Android studio build details from my Kubuntu machine, which I use the most:

Android Studio 4.0.1
Build #AI-193.6911.18.40.6626763, built on June 24, 2020
Runtime version: 1.8.0_242-release-1644-b3-6222593 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.4.0-42-generic
GC: ParNew, ConcurrentMarkSweep
Memory: 2014M
Cores: 4
Registry: ide.new.welcome.screen.force=true
Non-Bundled Plugins: 

This is the AndroidManifest.xml file. the activity I am trying to add is called .ItemActivity. The IDE is underlining it in red, saying that I don't have the accompanying class file and the resource file in the project, but I already know that.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.notekeeper" >

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".ItemsActivity"
            android:label="@string/title_activity_items"
            android:theme="@style/AppTheme.NoActionBar" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".NoteListActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".NoteActivity"
            android:label="@string/note_edit"
            android:theme="@style/AppTheme.NoActionBar" />
    </application>

</manifest>

0

There are 0 answers