Simple Notepad Application for Android OS
Revision | 724d0060f590b0feabc979e460320548863dc2ff (tree) |
---|---|
Time | 2019-05-04 23:35:08 |
Author | Masahiko, SAWAI <say@user...> |
Commiter | Masahiko, SAWAI |
Remove DB optimize background service.
@@ -1,3 +1,8 @@ | ||
1 | +1.0.17 | |
2 | +====== | |
3 | + | |
4 | +* Remove DB optimize background service | |
5 | + | |
1 | 6 | 1.0.12 |
2 | 7 | ====== |
3 | 8 |
@@ -245,8 +245,6 @@ | ||
245 | 245 | <!-- Service : data initialize service --> |
246 | 246 | <service android:name=".template.NoteTemplateInitializer" /> |
247 | 247 | |
248 | - <service android:name=".provider.NoteDBOptimizer" /> | |
249 | - | |
250 | 248 | <service android:name=".prefs.BackupDatabaseService" /> |
251 | 249 | |
252 | 250 | <!-- Provider : Notes & Templates Content Provider --> |
@@ -2,7 +2,7 @@ | ||
2 | 2 | /* |
3 | 3 | * The MIT License |
4 | 4 | * |
5 | - * Copyright 2012 Masahiko, SAWAI <masahiko.sawai@gmail.com>. | |
5 | + * Copyright 2012,2019 Masahiko, SAWAI <masahiko.sawai@gmail.com>. | |
6 | 6 | * |
7 | 7 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
8 | 8 | * of this software and associated documentation files (the "Software"), to deal |
@@ -53,7 +53,6 @@ import org.routine_work.notepad.fragment.NoteListFragment; | ||
53 | 53 | import org.routine_work.notepad.fragment.ViewNoteFragment; |
54 | 54 | import org.routine_work.notepad.prefs.NotepadPreferenceActivity; |
55 | 55 | import org.routine_work.notepad.prefs.NotepadPreferenceUtils; |
56 | -import org.routine_work.notepad.provider.NoteDBOptimizer; | |
57 | 56 | import org.routine_work.notepad.provider.NoteStore; |
58 | 57 | import org.routine_work.notepad.template.NoteTemplateInitializer; |
59 | 58 | import org.routine_work.notepad.template.NoteTemplatePickerDialogFragment; |
@@ -69,7 +68,6 @@ public class NotepadActivity extends Activity implements NotepadConstants, | ||
69 | 68 | { |
70 | 69 | |
71 | 70 | public static final String ACTION_QUIT = NotepadActivity.class.getPackage().getName() + ".ACTION_QUIT"; |
72 | - private static final int DB_OPTIMIZER_COUNT = 128; | |
73 | 71 | private static final String FT_NOTE_DETAIL = "FT_NOTE_DETAIL"; |
74 | 72 | private static final String FT_NOTE_TEMPLATE_PICKER = "FT_NOTE_TEMPLATE_PICKER"; |
75 | 73 | private static final String LOG_TAG = "simple-notepad"; |
@@ -194,13 +192,6 @@ public class NotepadActivity extends Activity implements NotepadConstants, | ||
194 | 192 | { |
195 | 193 | Log.v(LOG_TAG, "Hello"); |
196 | 194 | |
197 | - int quitCount = NotepadPreferenceUtils.incrementQuitCount(this); | |
198 | - if ((quitCount % DB_OPTIMIZER_COUNT) == 0) | |
199 | - { | |
200 | - Intent noteDBOptimizerIntent = new Intent(this, NoteDBOptimizer.class); | |
201 | - startService(noteDBOptimizerIntent); | |
202 | - } | |
203 | - | |
204 | 195 | super.onDestroy(); |
205 | 196 | |
206 | 197 | Log.v(LOG_TAG, "Bye"); |
@@ -327,7 +318,8 @@ public class NotepadActivity extends Activity implements NotepadConstants, | ||
327 | 318 | Log.v(LOG_TAG, "searchView.isIconified() => " + searchView.isIconified()); // androud 4 : true, androud 7 : false |
328 | 319 | Log.v(LOG_TAG, "searchView.isShown() => " + searchView.isShown()); |
329 | 320 | |
330 | - if ((keyCode == KeyEvent.KEYCODE_BACK) && searchView.isShown() && !searchView.isIconified()) | |
321 | + if ((keyCode == KeyEvent.KEYCODE_BACK) | |
322 | + && (searchView != null && searchView.isShown() && !searchView.isIconified())) | |
331 | 323 | { |
332 | 324 | Log.v(LOG_TAG, "Close SeachView"); |
333 | 325 | searchView.setQuery(null, false); |
@@ -240,8 +240,6 @@ | ||
240 | 240 | <!-- Service : data initialize service --> |
241 | 241 | <service android:name=".template.NoteTemplateInitializer" /> |
242 | 242 | |
243 | - <service android:name=".provider.NoteDBOptimizer" /> | |
244 | - | |
245 | 243 | <service android:name=".prefs.BackupDatabaseService" /> |
246 | 244 | |
247 | 245 | <!-- Provider : Notes & Templates Content Provider --> |
@@ -1,7 +1,7 @@ | ||
1 | 1 | /* |
2 | 2 | * The MIT License |
3 | 3 | * |
4 | - * Copyright 2012-2013 Masahiko, SAWAI <masahiko.sawai@gmail.com>. | |
4 | + * Copyright 2012-2013,2019 Masahiko, SAWAI <masahiko.sawai@gmail.com>. | |
5 | 5 | * |
6 | 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
7 | 7 | * of this software and associated documentation files (the "Software"), to deal |
@@ -47,7 +47,6 @@ import android.widget.AdapterView.OnItemClickListener; | ||
47 | 47 | import java.util.Arrays; |
48 | 48 | import org.routine_work.notepad.prefs.NotepadPreferenceActivity; |
49 | 49 | import org.routine_work.notepad.prefs.NotepadPreferenceUtils; |
50 | -import org.routine_work.notepad.provider.NoteDBOptimizer; | |
51 | 50 | import org.routine_work.notepad.provider.NoteStore; |
52 | 51 | import org.routine_work.notepad.template.NoteTemplateInitializer; |
53 | 52 | import org.routine_work.notepad.template.NoteTemplatePickerDialog; |
@@ -68,7 +67,6 @@ public class NotepadActivity extends ListActivity | ||
68 | 67 | NotepadConstants |
69 | 68 | { |
70 | 69 | |
71 | - private static final int DB_OPTIMIZER_COUNT = 128; | |
72 | 70 | private static final String LOG_TAG = "simple-notepad"; |
73 | 71 | private static final String ACTION_QUIT = NotepadConstants.class.getPackage().getName() + ".QUIT"; |
74 | 72 | private static final String SAVE_KEY_ACTION_MODE = "ACTION_MODE"; |
@@ -218,13 +216,6 @@ public class NotepadActivity extends ListActivity | ||
218 | 216 | cursor = null; |
219 | 217 | } |
220 | 218 | |
221 | - int quitCount = NotepadPreferenceUtils.incrementQuitCount(this); | |
222 | - if ((quitCount % DB_OPTIMIZER_COUNT) == 0) | |
223 | - { | |
224 | - Intent noteDBOptimizerIntent = new Intent(this, NoteDBOptimizer.class); | |
225 | - startService(noteDBOptimizerIntent); | |
226 | - } | |
227 | - | |
228 | 219 | super.onDestroy(); |
229 | 220 | |
230 | 221 | Log.v(LOG_TAG, "Bye"); |