Skip to content

Commit

Permalink
Add documentation to getActivity method of Util
Browse files Browse the repository at this point in the history
  • Loading branch information
hendrawd committed Jun 20, 2018
1 parent e6c0dc9 commit 31a3ed4
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ import android.content.ContextWrapper
*/
internal class Util {
companion object {
/**
* Copied and modified from
* <a href="https://stackoverflow.com/questions/8276634/android-get-hosting-activity-from-a-view/32973351#32973351">a stackoverflow answer</a>
* to always get an Activity from a View
*/
fun getActivity(context: Context): Activity? {
var mutableContext = context
while (mutableContext is ContextWrapper) {
Expand Down

0 comments on commit 31a3ed4

Please sign in to comment.