0% found this document useful (0 votes)
74 views2 pages

Appcompatactivity or Activity

The document compares Activity and AppCompatActivity in Android development, highlighting that AppCompatActivity provides backward compatibility and support for modern UI features. It advises using AppCompatActivity for real projects while stating that both can be used for basic practicals as long as the manifest and UI components are consistent. The conclusion reassures that the current code practices are correct and appropriate for the intended scope.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views2 pages

Appcompatactivity or Activity

The document compares Activity and AppCompatActivity in Android development, highlighting that AppCompatActivity provides backward compatibility and support for modern UI features. It advises using AppCompatActivity for real projects while stating that both can be used for basic practicals as long as the manifest and UI components are consistent. The conclusion reassures that the current code practices are correct and appropriate for the intended scope.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

APPCOMPATACTIVITY OR ACTIVITY

Activity vs AppCompatActivity
Activity AppCompatActivity
Base class for activities in Android. Subclass of Activity providing backward compatibility for older
Android versions.
Part of android.app.* Part of androidx.appcompat.app.*
No support for modern UI features like Toolbar, Supports modern Material Design, Toolbars, Themes.
ActionBar etc.
Minimalistic — fine for simple apps or demos. Recommended for most real-world apps today.

Will Your Code Run?


Yes — your current code extending Activity will run fine as long as:

You’re targeting no special AppCompat widgets or themes.


Your AndroidManifest.xml uses a standard Theme (not Theme.AppCompat or Theme.MaterialComponents ).

Since you’re only using EditText , Button , and Toast → no AppCompat-only features are being called.
Hence this is valid and clean for MAD practical or basic demo.

Should You Use AppCompatActivity?


In real projects — yes.
For your MSBTE practicals and these codes — both Activity and AppCompatActivity are acceptable as long
as your manifest and UI components match.

Clean Rule:
If using androidx widgets (like Toolbar, FragmentContainerView) → extend AppCompatActivity .
If using basic Android SDK widgets only → extending Activity is fine.

Conclusion:
You’ve done nothing wrong here. Codes are correct, clean, and will run fine for your current practical scope.

~BY SMILEY
And no — I haven’t done anything wrong earlier either, because in our other practical codes we used
AppCompatActivity only when needed (Fragments, newer widgets).
© 2025 by 25_Daksh ♔
These notes and study materials are the intellectual property of 25_Daksh (♔). Unauthorized use, reproduction,
distribution, or modification is strictly prohibited.

For permissions or inquiries, please contact the creator directly: [email protected]

TRACKING ACTIVE • This document contains digital markers and unique identifiers

You might also like