I have a Fragment
with a ListView
. In the adapter I want to create a dialog.
class ViewHolder {
...
@Override
public void onClick(View v) {
...
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
...
}
...
}
mContext
is the Context
from my Fragment
, which I save global when the adapter is created.
I get the error.
unable to add window -- token null is not for an application
The method getActivity()
is not available so how to get the Context
of my Activity
?
View.getContext()
? ... anyway:which i save global when the adapter is created
do you store Context(which is not Application) somehere as global(FSM save us)? – Sulphanilamide