From 9d4365cc79580185f85ad6a5b3dc9cf7bf98edbf Mon Sep 17 00:00:00 2001 From: serso Date: Sun, 24 Jan 2016 23:45:31 +0100 Subject: [PATCH] Make cursor string static, otherwise, it is created every time CAppWidgetProvider is created --- .../calculator/widget/CalculatorWidget.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/org/solovyev/android/calculator/widget/CalculatorWidget.java b/app/src/main/java/org/solovyev/android/calculator/widget/CalculatorWidget.java index c0928246..231ff3f2 100644 --- a/app/src/main/java/org/solovyev/android/calculator/widget/CalculatorWidget.java +++ b/app/src/main/java/org/solovyev/android/calculator/widget/CalculatorWidget.java @@ -40,29 +40,19 @@ import android.text.SpannedString; import android.text.TextUtils; import android.text.style.StyleSpan; import android.widget.RemoteViews; - import org.solovyev.android.Check; import org.solovyev.android.Views; -import org.solovyev.android.calculator.App; -import org.solovyev.android.calculator.CalculatorButton; -import org.solovyev.android.calculator.DisplayState; -import org.solovyev.android.calculator.EditorState; -import org.solovyev.android.calculator.Locator; +import org.solovyev.android.calculator.*; import org.solovyev.android.calculator.Preferences.SimpleTheme; -import org.solovyev.android.calculator.R; - -import java.util.EnumMap; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import java.util.EnumMap; import static android.appwidget.AppWidgetManager.OPTION_APPWIDGET_MIN_HEIGHT; import static android.content.Intent.ACTION_CONFIGURATION_CHANGED; import static android.os.Build.VERSION_CODES.JELLY_BEAN; -import static org.solovyev.android.calculator.Broadcaster.ACTION_DISPLAY_STATE_CHANGED; -import static org.solovyev.android.calculator.Broadcaster.ACTION_EDITOR_STATE_CHANGED; -import static org.solovyev.android.calculator.Broadcaster.ACTION_INIT; -import static org.solovyev.android.calculator.Broadcaster.ACTION_THEME_CHANGED; +import static org.solovyev.android.calculator.Broadcaster.*; import static org.solovyev.android.calculator.CalculatorReceiver.newButtonClickedIntent; public class CalculatorWidget extends AppWidgetProvider { @@ -74,7 +64,7 @@ public class CalculatorWidget extends AppWidgetProvider { @Nonnull private static final Intents intents = new Intents(); @Nullable - private SpannedString cursorString; + private static SpannedString cursorString; public CalculatorWidget() { }