android No enclosing instance of type BasicActivity is accessible. Must qualify the allocation with

No enclosing instance of type BasicActivity is accessible. Must qualify the allocation with an enclosing instance of type BasicActivity (e.g. x.new A() where x is an instance of BasicActivity).


描述:

BasicActivity.java中写了一个public class 的内部类,在另一个java文件中引用,自动编译出现如上提示。


解决方法:

把内部类public class改成public static class就可以了。


如下图:



参考:

http://blog.csdn.net/sunny2038/article/details/6926079

你可能感兴趣的:(android开发)