You just need an activity context passed in your constructor. Be sure to call new Adapter(this,...)
from activities and new Adapter(getActivity(),...)
from fragments.
private Context context;
@Override
public void onClick(View v) {
FragmentManager manager = ((AppCompatActivity)context).getSupportFragmentManager();
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…