mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Fix small corner case errors from crash logs
git-svn-id: https://zxing.googlecode.com/svn/trunk@2363 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
53ace36930
commit
1fbad444ee
|
@ -70,11 +70,13 @@ final class BookmarkAdapter extends BaseAdapter {
|
|||
layout = (LinearLayout) factory.inflate(R.layout.bookmark_picker_list_item, viewGroup, false);
|
||||
}
|
||||
|
||||
cursor.moveToPosition(index);
|
||||
String title = cursor.getString(BookmarkPickerActivity.TITLE_COLUMN);
|
||||
((TextView) layout.findViewById(R.id.bookmark_title)).setText(title);
|
||||
String url = cursor.getString(BookmarkPickerActivity.URL_COLUMN);
|
||||
((TextView) layout.findViewById(R.id.bookmark_url)).setText(url);
|
||||
if (!cursor.isClosed()) {
|
||||
cursor.moveToPosition(index);
|
||||
String title = cursor.getString(BookmarkPickerActivity.TITLE_COLUMN);
|
||||
((TextView) layout.findViewById(R.id.bookmark_title)).setText(title);
|
||||
String url = cursor.getString(BookmarkPickerActivity.URL_COLUMN);
|
||||
((TextView) layout.findViewById(R.id.bookmark_url)).setText(url);
|
||||
} // Otherwise... just don't update as the object is shutting down
|
||||
return layout;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ public final class BookmarkPickerActivity extends ListActivity {
|
|||
|
||||
@Override
|
||||
protected void onListItemClick(ListView l, View view, int position, long id) {
|
||||
if (cursor.moveToPosition(position)) {
|
||||
if (!cursor.isClosed() && cursor.moveToPosition(position)) {
|
||||
Intent intent = new Intent();
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
|
||||
intent.putExtra(Browser.BookmarkColumns.TITLE, cursor.getString(TITLE_COLUMN));
|
||||
|
|
|
@ -314,7 +314,7 @@ public final class VCardResultParser extends ResultParser {
|
|||
int start = 0;
|
||||
int end;
|
||||
int componentIndex = 0;
|
||||
while ((end = name.indexOf(';', start)) > 0) {
|
||||
while (componentIndex < components.length - 1 && (end = name.indexOf(';', start)) > 0) {
|
||||
components[componentIndex] = name.substring(start, end);
|
||||
componentIndex++;
|
||||
start = end + 1;
|
||||
|
|
Loading…
Reference in a new issue