diff options
author | zachh <zachh@google.com> | 2017-12-20 14:32:47 -0800 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-12-22 08:55:15 -0800 |
commit | 128d859aa0e678971c85d00d4417c9ca79a8b702 (patch) | |
tree | a321c959b6c0042126f6f44d95a4b7fc8cd4789f /java/com/android/dialer/main/impl/MainPagerAdapter.java | |
parent | 6456d8302885e9c6f24d678fca798b730d101a17 (diff) |
Fixed crash in UiListener when launching activity with screen off.
When launching MainActivity with the screen off (e.g. from Android Studio) the application would crash due to:
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
Also use FragmentPagerAdapter in MainPagerAdapter as the number of tabs is small and can be stored in memory.
Test: manual
PiperOrigin-RevId: 179734952
Change-Id: Ib2ca9674f3174493da55bbbf0ef4053fcf73ab47
Diffstat (limited to 'java/com/android/dialer/main/impl/MainPagerAdapter.java')
-rw-r--r-- | java/com/android/dialer/main/impl/MainPagerAdapter.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/java/com/android/dialer/main/impl/MainPagerAdapter.java b/java/com/android/dialer/main/impl/MainPagerAdapter.java index 2d224f69c..d294640ee 100644 --- a/java/com/android/dialer/main/impl/MainPagerAdapter.java +++ b/java/com/android/dialer/main/impl/MainPagerAdapter.java @@ -20,7 +20,7 @@ import android.content.Context; import android.support.annotation.IntDef; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentManager; -import android.support.v4.app.FragmentStatePagerAdapter; +import android.support.v4.app.FragmentPagerAdapter; import com.android.dialer.calllog.ui.NewCallLogFragment; import com.android.dialer.common.Assert; import com.android.dialer.voicemail.listui.NewVoicemailFragment; @@ -28,7 +28,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** Adapter for {@link MainActivity} ViewPager. */ -final class MainPagerAdapter extends FragmentStatePagerAdapter { +final class MainPagerAdapter extends FragmentPagerAdapter { @Retention(RetentionPolicy.SOURCE) @IntDef({ |