I am trying to call getActivity () in OnItemClickListener:
class ViewTest{
}
In the fragment, the class is created as:
ViewTest editTest = new ViewTest(this);
But I get an error message that I canβt fix:
The method getActivity() is undefined for the type new AdapterView.OnItemClickListener(){}
How can I call getActivity inside onItemClick ()? Thanks.
java android casting onitemclick main-activity
user2212461
source share