I want to make a custom class AppCompatActivity there I can add my basic function and methods like hiding soft keyboard, hiding progress bar, and other methods that going to be used in the whole project constantly.
CodePudding user response:
Normally those utilities functions don't need an Activity to hold them, instead they will be put on another file: utils/ActivityUtils.java
.
Here is an example in an Android Java project: https://github.com/Blankj/AndroidUtilCode/blob/master/lib/utilcode/src/main/java/com/blankj/utilcode/util/ActivityUtils.java
And in Kotlin: https://github.com/inusedname/Todo-App/blob/master/app/src/main/java/com/vstd/todo/others/utilities/ActivityUtils.kt