onOptionsItemSelected(MenuItem item) {
if(particular menuitem selected) {
//Helper class has static methods isOnline() and showNoConnectionDialog
if(HelperClass.isOnline(this)) {
//code ....
} else {
HelperClass.showNoConnectionDialog(getApplicationContext());
}
}
代码给了我一个错误......当我不使用静态方法时它工作得很好......任何人都可以帮助我...谢谢
答案 0 :(得分:0)
尝试将HelperClass.isOnline(this)
替换为HelperClass.isOnline(getApplicationContext())