aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/activity
diff options
context:
space:
mode:
authorMichael Keppler <bananeweizen@gmx.de>2013-12-25 08:05:42 +0100
committerMichael Keppler <bananeweizen@gmx.de>2013-12-25 08:05:42 +0100
commit7cdf30c21ad29c0b51e3a2e44f86932e981817a0 (patch)
tree0d37117c091bd02350104790ecdbccffe4f0d18c /main/src/cgeo/geocaching/activity
parent78346dc4d407493b659d0076bfb66ba540a9002f (diff)
downloadcgeo-7cdf30c21ad29c0b51e3a2e44f86932e981817a0.zip
cgeo-7cdf30c21ad29c0b51e3a2e44f86932e981817a0.tar.gz
cgeo-7cdf30c21ad29c0b51e3a2e44f86932e981817a0.tar.bz2
fix #3471: avoid null being possible in the interface
This change also prohibits the same error to occur again in another implementation of the same interface and should therefore be preferred to just checking for null in the current interface implementation.
Diffstat (limited to 'main/src/cgeo/geocaching/activity')
-rw-r--r--main/src/cgeo/geocaching/activity/AbstractViewPagerActivity.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/main/src/cgeo/geocaching/activity/AbstractViewPagerActivity.java b/main/src/cgeo/geocaching/activity/AbstractViewPagerActivity.java
index bb0273f..24c0a1b 100644
--- a/main/src/cgeo/geocaching/activity/AbstractViewPagerActivity.java
+++ b/main/src/cgeo/geocaching/activity/AbstractViewPagerActivity.java
@@ -7,6 +7,7 @@ import com.viewpagerindicator.TitlePageIndicator;
import com.viewpagerindicator.TitleProvider;
import org.apache.commons.lang3.tuple.Pair;
+import org.eclipse.jdt.annotation.NonNull;
import android.app.Activity;
import android.os.Bundle;
@@ -90,7 +91,7 @@ public abstract class AbstractViewPagerActivity<Page extends Enum<Page>> extends
/**
* Set the state of the view
*/
- public void setViewState(Bundle state);
+ public void setViewState(@NonNull Bundle state);
}
/**
@@ -153,7 +154,9 @@ public abstract class AbstractViewPagerActivity<Page extends Enum<Page>> extends
// Restore the state of the view if the page supports it
Bundle state = viewStates.get(page);
- creator.setViewState(state);
+ if (state != null) {
+ creator.setViewState(state);
+ }
container.addView(view, 0);
}