mirror of
https://github.com/zxing/zxing.git
synced 2024-11-09 20:44:03 -08:00
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:
parent
61919d0be7
commit
a9fe6ccde1
|
@ -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"/>
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue