-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Initial activation of the back button through the SDK works successfully, with the button functioning correctly during normal background-foreground transitions. However, it has been observed that after a period of prolonged inactivity in the background, the back button ceases to respond.
After some investigation we discovered that you forget to save/restore the state of back button in/from the bundle:
// save the state
public void saveInstanceState(Bundle outState) {
outState.putString("queueUrl", queueUrl);
outState.putString("targetUrl", targetUrl);
outState.putString("userId", uriOverrider.getUserId());
}
// restore the state
private void readActivityExtras(Bundle savedInstanceState) {
if (savedInstanceState == null) {
Bundle extras = _context.getIntent().getExtras();
if (extras == null) {
queueUrl = null;
targetUrl = null;
} else {
queueUrl = extras.getString("queueUrl");
targetUrl = extras.getString("targetUrl");
uriOverrider.setUserId(extras.getString("userId"));
options = (QueueItEngineOptions)extras.getParcelable("options");
}
} else {
queueUrl = (String) savedInstanceState.getSerializable("queueUrl");
targetUrl = (String) savedInstanceState.getSerializable("targetUrl");
uriOverrider.setUserId((String) savedInstanceState.getSerializable("userId"));
}
uriOverrider.setTarget(Uri.parse(targetUrl));
uriOverrider.setQueue(Uri.parse(queueUrl));
}
Instead of:
// save the state
public void saveInstanceState(Bundle outState) {
outState.putString("queueUrl", queueUrl);
outState.putString("targetUrl", targetUrl);
outState.putString("userId", uriOverrider.getUserId());
outState.putParcelable("options", options); <-- HERE
}
// restore the state
private void readActivityExtras(Bundle savedInstanceState) {
if (savedInstanceState == null) {
...
} else {
queueUrl = (String) savedInstanceState.getSerializable("queueUrl");
targetUrl = (String) savedInstanceState.getSerializable("targetUrl");
uriOverrider.setUserId((String) savedInstanceState.getSerializable("userId"));
options = (QueueItEngineOptions) savedInstanceState.getParcelable("options"); <-- HERE
}
...
}
Metadata
Metadata
Assignees
Labels
No labels