我试图显示一个AlertDialog
,但当我调用show
函数时出现错误。我用下面的代码,从代码Hello Mapview
样品复制:“AlertDialog”问题
AlertDialog.Builder dialog = new AlertDialog.Builder(context);
dialog.setTitle(article.getTitle());
dialog.setMessage(article.getSnippet());
dialog.show();
应用程序崩溃正在执行中的最后一行时。我怀疑context
变量,但它没有内疚,因为有了它,我可以显示Toast
。
在此先感谢您花费时间来帮助我。
如果可能,请在此处发布错误日志。 – Chandan