mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Issue 1256 Avoid crash clearing Empty message
git-svn-id: https://zxing.googlecode.com/svn/trunk@2271 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
3e0ec6f708
commit
3e2dce9bd7
|
@ -81,7 +81,9 @@ public final class HistoryActivity extends ListActivity {
|
|||
View v,
|
||||
ContextMenu.ContextMenuInfo menuInfo) {
|
||||
int position = ((AdapterView.AdapterContextMenuInfo) menuInfo).position;
|
||||
menu.add(Menu.NONE, position, position, R.string.history_clear_one_history_text);
|
||||
if (position >= adapter.getCount() || adapter.getItem(position).getResult() != null) {
|
||||
menu.add(Menu.NONE, position, position, R.string.history_clear_one_history_text);
|
||||
} // else it's just that dummy "Empty" message
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue