I am using this code from the sample app to detect if the user's session has timed out while using the app. I've pasted it below:
if (AppManager.merchant == null) {
Intent i = new Intent(context, LoginActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(i);
finish();
return;
}
It is not working - AppManager.mercant never comes back as null even if the session has timed out. The user does not find out that the session has timed out until they have already swiped the customer's card and it returns an error, causing them to have to repeat the login process over again. Is there another way that I can check if the session has timed out that would be more reliable? Any help would be greatly appreciated.