Commit b3fc35a5 by Kunj Gupta

Fixed - App is getting crash when we are trying to logout offline.

parent bd49c377
......@@ -20,6 +20,7 @@ import com.vsoft.servicenow.api.managers.LoginApiManager;
import com.vsoft.servicenow.enums.SyncStatus;
import com.vsoft.servicenow.menu.HomeScreenMenuItemData;
import com.vsoft.servicenow.utils.Constants;
import com.vsoft.servicenow.utils.DialogUtils;
import com.vsoft.servicenow.utils.PrefManager;
import com.vsoft.servicenow.utils.Util;
......@@ -101,7 +102,11 @@ public class HomeScreen extends HandleNotificationActivity {
.setCancelable(false)
.setPositiveButton(R.string.ok_string, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
new LogoutTask().execute();
if(((CatalogueApplication)getApplication()).isNetConnected()) {
new LogoutTask().execute();
} else {
DialogUtils.showNoConnectionDialog(HomeScreen.this);
}
}
})
.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment