我正在开发一个Android应用程序,但遇到了一些问题,我一直在收到这个错误:
Illegal modifier for the class FavsPopupFragment; only public, abstract & final are permitted
在遵循这个答案指引之后出现了这种情况。下面是我拥有的代码:
package com.package.name;
/* Imports were here */
public static class FavsPopupFragment extends SherlockDialogFragment {
static FavsPopupFragment newInstance() {
FavsPopupFragment frag = new FavsPopupFragment();
return frag;
}
}
错误出现在类名上。我不明白为什么这样做不起作用,请帮忙解决。谢谢。
FavsPopupFragment
放入另一个类中。 - Sanjay T. Sharma