androidandroid-activityormandroid-appcompatormlite

OrmLiteBaseActivity vs. AppCompatActivity?


I am trying to use ORMLite in my app (because apparently writing all the CRUD methods myself is the "harder not smarter" way to develop), but I am running into a problem: A lot of the sample projects I see have Activities that extend OrmLiteBaseActivity. Normally my Activities extend AppCompatActivity.

Is this going to be a problem at all? Does OrmLiteBaseActivity extend AppCompatActivity anywhere? Or do I have to sacrifice AppCompat if I go with ORMLite?


Solution

  • I'm not familiar with ORMLite however I wouldn't recommend dropping AppCompat in favor of ORMLite. So what can you do?

    By looking at the source of ORMLiteBaseActivity you can see that this class extends Activity and not AppCompatActivity which basically makes sense for a library. Furthermore you can see that the class doesn't do much.

    So Option #1 don't use the ORMLiteBaseActivity or Option #2 create an own Base Activity for your app which extends AppCompatActivity and does the same as the ORMLiteBaseActivity. In other words: It would be an option to copy the class in your project and to simply replace the extends part.