I have my application code base with multiple activities in it. I have a BaseActivity
class which extends Activity
class and is the parent class for all Activities in my application. BaseActivity
takes care of the state my application goes in background and comes back to foreground.
Now I have written few more Activities which are using fragments
so these new Activities are extending FragmentActivity
. But my application design requires that all activities should extend BaseActivity
class.
Solution in my mind:
With this solution I am afraid of any side effect in my existing activities which were extending Activity
class (through BaseActivity
). Now these activities will extend FragmentActivity
(although they are not having fragments inside).
Is it okay if I extend FragmentActivity
even though I dont have any fragment inside. Will it behave same as Activity?
as FragmentActivity extends Activity
so looks it's fine.jsut you need to add compitiblilty library if want to give the support for old versions
http://developer.android.com/reference/android/support/v4/app/FragmentActivity.html
Even I did same and found no side effect yet
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With