Thorvald
Thorvald

Reputation: 3563

method returns AppCompatActivity in a Fragment

I am trying to implement an AlertView library from GitHub in a fragment and the show() method returns AppCompatActivity so basically is must be like so : show(this); but since I'm in a fragment I cannot do that, I tried :

but nothing worked.

So my question is how to return AppCompatActivity while I'm inside a fragment

P.S. I tried to read the documentation but found nothing

Upvotes: 0

Views: 97

Answers (1)

AskNilesh
AskNilesh

Reputation: 69724

Try this

alertView.show((AppCompatActivity)getActivity());

Upvotes: 1

Related Questions