Android2.3 PopupWindow在实例化时报空指针异常

  类 test 继承PopupWindow在实例化test时,android 4.0以上项目没有问题,用2.3时报空指针异常。


解决方法:

在构造方法最前面加  super();

如:(无参构造方法)

public test (){
     super();
}

(有参)

public test (Context context){
     super(context);
}



猜你喜欢

转载自blog.csdn.net/opingu/article/details/46005885