mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -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);
|
layout = (LinearLayout) factory.inflate(R.layout.bookmark_picker_list_item, viewGroup, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
cursor.moveToPosition(index);
|
if (!cursor.isClosed()) {
|
||||||
String title = cursor.getString(BookmarkPickerActivity.TITLE_COLUMN);
|
cursor.moveToPosition(index);
|
||||||
((TextView) layout.findViewById(R.id.bookmark_title)).setText(title);
|
String title = cursor.getString(BookmarkPickerActivity.TITLE_COLUMN);
|
||||||
String url = cursor.getString(BookmarkPickerActivity.URL_COLUMN);
|
((TextView) layout.findViewById(R.id.bookmark_title)).setText(title);
|
||||||
((TextView) layout.findViewById(R.id.bookmark_url)).setText(url);
|
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;
|
return layout;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,7 +65,7 @@ public final class BookmarkPickerActivity extends ListActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onListItemClick(ListView l, View view, int position, long id) {
|
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 intent = new Intent();
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
|
||||||
intent.putExtra(Browser.BookmarkColumns.TITLE, cursor.getString(TITLE_COLUMN));
|
intent.putExtra(Browser.BookmarkColumns.TITLE, cursor.getString(TITLE_COLUMN));
|
||||||
|
|
|
@ -314,7 +314,7 @@ public final class VCardResultParser extends ResultParser {
|
||||||
int start = 0;
|
int start = 0;
|
||||||
int end;
|
int end;
|
||||||
int componentIndex = 0;
|
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);
|
components[componentIndex] = name.substring(start, end);
|
||||||
componentIndex++;
|
componentIndex++;
|
||||||
start = end + 1;
|
start = end + 1;
|
||||||
|
|
Loading…
Reference in a new issue