android - Storing Activity context in Bundle -


i using static factory method create fragment. need use activity's context in fragment , therefore need wrap context bundle , attach fragment using setarguements() method can retrieve later.

but if try store context doing bundle.putserializable("tag", context) -> throws error. can tell me how wrap activity context bundle?

but need use activity's context in fragment

you not need in cases. need use getactivity() in fragment instead.


Comments