Reputation: 5954
After the ADT update in eclipse whenever I create a new project for android a default fragment activity is created. How to get to create simple activity always?
I don't want to downgrade the ADT.
Is this possible? any work around?
Upvotes: 0
Views: 264
Reputation: 1178
As an Activity is simply a Java class, just accept the defaults the ADT gives you during the initial creation of your project. Create your project, then manually:
1. Delete all the class
and layout
files in your project.
2. Create your Java
class files extending Activity
(in your desired packages).
3. Create XML layout files (in the res/layout
folder).
4. 'Wire-up' your Java class files and XML layout files using setContentView(R.layout.YOUR_LAYOUT_ID)
in the onCreate()
methods.
5. Done!
EDIT
Remember to Register your Activities in the Manifest manually as well.
Upvotes: 1
Reputation: 23648
The latest ADT plugins are made in such a way that if you create any simple project you will always get the FragmentActivity
not a simple Activity
. And you can not change it.
In new ADT itself there is Blank Activity that is defined with an actionbar and optional navigational elements such as tabs or horizontal swipe.
If you want to create simple activity in your project then you can simply create class and extends Activity into it, this is the only way now. Or you can change the Fragment
with Activity
simply by changing code only.
Upvotes: 2