Via : OpenAndroid.in
Tags :
Orginal Post: Android How to get Activity from Context

Example_sketch

Sometimes we pass context of an activity as a parameter to some other function and later we might want the activity too. So instead of passing the activity also to that function, we can get the activity from context itself.

Method 1

You can get the activity from the context by type casting the context to activity.



Via : OpenAndroid.in
Tags :
Orginal Post: Android How to get Activity from Context

0 comments:

Post a Comment

 
Top