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