Add count to history activity title

git-svn-id: https://zxing.googlecode.com/svn/trunk@2883 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen@gmail.com 2013-09-06 09:36:12 +00:00
parent 61919d0be7
commit a9fe6ccde1
2 changed files with 5 additions and 2 deletions

View file

@ -16,8 +16,8 @@
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.zxing.client.android"
android:versionName="4.5"
android:versionCode="93"
android:versionName="4.5.1"
android:versionCode="94"
android:installLocation="auto">
<uses-permission android:name="android.permission.CAMERA"/>

View file

@ -44,6 +44,7 @@ public final class HistoryActivity extends ListActivity {
private HistoryManager historyManager;
private ArrayAdapter<HistoryItem> adapter;
private CharSequence originalTitle;
@Override
protected void onCreate(Bundle icicle) {
@ -53,6 +54,7 @@ public final class HistoryActivity extends ListActivity {
setListAdapter(adapter);
View listview = getListView();
registerForContextMenu(listview);
originalTitle = getTitle();
}
@Override
@ -67,6 +69,7 @@ public final class HistoryActivity extends ListActivity {
for (HistoryItem item : items) {
adapter.add(item);
}
setTitle(originalTitle + " (" + adapter.getCount() + ')');
if (adapter.isEmpty()) {
adapter.add(new HistoryItem(null, null, null));
}