We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e6c0dc9 commit 31a3ed4Copy full SHA for 31a3ed4
library/src/main/java/id/co/ionsoft/randomnumberanimationlibrary/Util.kt
@@ -33,6 +33,11 @@ import android.content.ContextWrapper
33
*/
34
internal class Util {
35
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
+ */
41
fun getActivity(context: Context): Activity? {
42
var mutableContext = context
43
while (mutableContext is ContextWrapper) {
0 commit comments