Skip to content

Commit 31a3ed4

Browse files
committed
Add documentation to getActivity method of Util
1 parent e6c0dc9 commit 31a3ed4

File tree

1 file changed

+5
-0
lines changed
  • library/src/main/java/id/co/ionsoft/randomnumberanimationlibrary

1 file changed

+5
-0
lines changed

library/src/main/java/id/co/ionsoft/randomnumberanimationlibrary/Util.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ import android.content.ContextWrapper
3333
*/
3434
internal class Util {
3535
companion object {
36+
/**
37+
* Copied and modified from
38+
* <a href="https://stackoverflow.com/questions/8276634/android-get-hosting-activity-from-a-view/32973351#32973351">a stackoverflow answer</a>
39+
* to always get an Activity from a View
40+
*/
3641
fun getActivity(context: Context): Activity? {
3742
var mutableContext = context
3843
while (mutableContext is ContextWrapper) {

0 commit comments

Comments
 (0)