AlertDialog.Builder builder = new AlertDialog.Builder(MainDialog.this);
搞不清楚MainDialog.this这个是个什么对象,有的是
AlertDialog.Builder builder = new AlertDialog.Builder(this);
只要一创建builder对象,虚拟设备中就提示:
The application Test2New(process com.zh2)has stopped unexpectedly.please try again;
什么突发事件停止,
搞不清楚MainDialog.this这个是个什么对象,有的是
AlertDialog.Builder builder = new AlertDialog.Builder(this);
只要一创建builder对象,虚拟设备中就提示:
The application Test2New(process com.zh2)has stopped unexpectedly.please try again;
什么突发事件停止,
警告提示
LZ只要记住,如果在匿名类的方法中要调用上一层的对象,就用对象.this.XXX
AlertDialog.Builder builder = new AlertDialog.Builder(MainDialog.this);
//MainDialog是当前类名称;MainDialog.this理解成一个“上下文环境”
//你可以把AlertDialog.Builder builder = new AlertDialog.Builder(this); 中的this换成MainDialog.this
Test2NewActivity这个是我的类,我改了,编译通过了,但是还是提示The application Test2New(process com.zh2)has stopped unexpectedly.please try again;
想自杀了,抓狂中......