我有上下文发送到适配器如何在Adapter类中使用AlertDialog?
public ImageAdapter(Context context, List<Image> imagesList) {
this.context = context;
mImageList = imagesList;
}
我使用AlertDialog这样:
AlertDialog.Builder builder = new AlertDialog.Builder(context, R.style.AlertDialogCustom);
但我得到的错误:
Unable to add window -- token null is not valid; is your activity running?
嘿,如果您觉得答案解决了问题,请将其标记为'接受'通过单击绿色的复选标记。这有助于将注意力集中在仍然没有答案的旧版SO上。 –