user2357113
user2357113

Reputation: 171

How can i make my custom AppCompatActivity class for some function?

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.

Upvotes: 0

Views: 354

Answers (1)

VanSuTuyDuyen
VanSuTuyDuyen

Reputation: 465

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

Upvotes: 2

Related Questions