MATHANGSPK BLOG

Chia sẽ các thủ thuật về máy tính, tin học, các kiến thức điện tử cơ bản

Chủ Nhật, 23 tháng 7, 2017

Lỗi Default Activity Not Found trong Android Studio


Nguyên nhân bị lỗi này là do chúng ta đã xóa giao diện Default của Project. Để thêm trang default chúng ta làm như sau:
Khi bị lỗi này chúng ta thực hiện như sau:
enter image description here
Step 1: Select Edit Configurations
enter image description here
Step 2: Sẽ có cảnh báo watch this warning: Default Activity not found enter image description here
Step 3: select a default activity, lúc này các bạn sẽ chọn lại Default Activity.enter image description here
enter image description here
Step 3: Tiếp đến các bạn sẽ thêm đoạn code này vào file AndroidManifest.xml

<activity
        android:name="com.your.package.name.YourActivity"
        android:label="@string/app_name">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
</activity>
Step 4: Save your changes and finish
enter image description here
Chúc các bạn thành công

Không có nhận xét nào:

Đăng nhận xét

Adbox