Merge "Prevent attribution/ comments from getting cut off"
diff --git a/res/drawable-hdpi/ab_solid_custom_blue_inverse_holo.9.png b/res/drawable-hdpi/ab_solid_custom_blue_inverse_holo.9.png
index 80fb400..956d61b 100644
--- a/res/drawable-hdpi/ab_solid_custom_blue_inverse_holo.9.png
+++ b/res/drawable-hdpi/ab_solid_custom_blue_inverse_holo.9.png
Binary files differ
diff --git a/res/drawable-hdpi/account_spinner_icon.png b/res/drawable-hdpi/account_spinner_icon.png
index 3e82e51..9566386 100644
--- a/res/drawable-hdpi/account_spinner_icon.png
+++ b/res/drawable-hdpi/account_spinner_icon.png
Binary files differ
diff --git a/res/drawable-hdpi/list_section_divider_holo_custom.9.png b/res/drawable-hdpi/list_section_divider_holo_custom.9.png
index 6c0d251..1e3e778 100644
--- a/res/drawable-hdpi/list_section_divider_holo_custom.9.png
+++ b/res/drawable-hdpi/list_section_divider_holo_custom.9.png
Binary files differ
diff --git a/res/drawable-mdpi/ab_solid_custom_blue_inverse_holo.9.png b/res/drawable-mdpi/ab_solid_custom_blue_inverse_holo.9.png
index f3c0a90..3e9f167 100644
--- a/res/drawable-mdpi/ab_solid_custom_blue_inverse_holo.9.png
+++ b/res/drawable-mdpi/ab_solid_custom_blue_inverse_holo.9.png
Binary files differ
diff --git a/res/drawable-mdpi/account_spinner_icon.png b/res/drawable-mdpi/account_spinner_icon.png
index d9aaf02..e159d59 100644
--- a/res/drawable-mdpi/account_spinner_icon.png
+++ b/res/drawable-mdpi/account_spinner_icon.png
Binary files differ
diff --git a/res/drawable-mdpi/list_section_divider_holo_custom.9.png b/res/drawable-mdpi/list_section_divider_holo_custom.9.png
index cfc57ee..1d8fd09 100644
--- a/res/drawable-mdpi/list_section_divider_holo_custom.9.png
+++ b/res/drawable-mdpi/list_section_divider_holo_custom.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/ab_solid_custom_blue_inverse_holo.9.png b/res/drawable-xhdpi/ab_solid_custom_blue_inverse_holo.9.png
index 3c97b20..31fea59 100644
--- a/res/drawable-xhdpi/ab_solid_custom_blue_inverse_holo.9.png
+++ b/res/drawable-xhdpi/ab_solid_custom_blue_inverse_holo.9.png
Binary files differ
diff --git a/res/drawable-xhdpi/account_spinner_icon.png b/res/drawable-xhdpi/account_spinner_icon.png
index 8b888cb..d3d3cac 100644
--- a/res/drawable-xhdpi/account_spinner_icon.png
+++ b/res/drawable-xhdpi/account_spinner_icon.png
Binary files differ
diff --git a/res/drawable-xhdpi/list_section_divider_holo_custom.9.png b/res/drawable-xhdpi/list_section_divider_holo_custom.9.png
index 32e79e1..0bd8a0f 100644
--- a/res/drawable-xhdpi/list_section_divider_holo_custom.9.png
+++ b/res/drawable-xhdpi/list_section_divider_holo_custom.9.png
Binary files differ
diff --git a/src/com/android/contacts/interactions/ImportExportDialogFragment.java b/src/com/android/contacts/interactions/ImportExportDialogFragment.java
index a6a37ef..078f63e 100644
--- a/src/com/android/contacts/interactions/ImportExportDialogFragment.java
+++ b/src/com/android/contacts/interactions/ImportExportDialogFragment.java
@@ -136,30 +136,32 @@
// TODO move the query into a loader and do this in a background thread
final Cursor cursor = getActivity().getContentResolver().query(Contacts.CONTENT_URI,
LOOKUP_PROJECTION, Contacts.IN_VISIBLE_GROUP + "!=0", null, null);
- try {
- if (!cursor.moveToFirst()) {
- Toast.makeText(getActivity(), R.string.share_error, Toast.LENGTH_SHORT).show();
- return;
- }
+ if (cursor != null) {
+ try {
+ if (!cursor.moveToFirst()) {
+ Toast.makeText(getActivity(), R.string.share_error, Toast.LENGTH_SHORT).show();
+ return;
+ }
- StringBuilder uriListBuilder = new StringBuilder();
- int index = 0;
- while (cursor.moveToNext()) {
- if (index != 0)
- uriListBuilder.append(':');
- uriListBuilder.append(cursor.getString(0));
- index++;
- }
- Uri uri = Uri.withAppendedPath(
- Contacts.CONTENT_MULTI_VCARD_URI,
- Uri.encode(uriListBuilder.toString()));
+ StringBuilder uriListBuilder = new StringBuilder();
+ int index = 0;
+ do {
+ if (index != 0)
+ uriListBuilder.append(':');
+ uriListBuilder.append(cursor.getString(0));
+ index++;
+ } while (cursor.moveToNext());
+ Uri uri = Uri.withAppendedPath(
+ Contacts.CONTENT_MULTI_VCARD_URI,
+ Uri.encode(uriListBuilder.toString()));
- final Intent intent = new Intent(Intent.ACTION_SEND);
- intent.setType(Contacts.CONTENT_VCARD_TYPE);
- intent.putExtra(Intent.EXTRA_STREAM, uri);
- getActivity().startActivity(intent);
- } finally {
- cursor.close();
+ final Intent intent = new Intent(Intent.ACTION_SEND);
+ intent.setType(Contacts.CONTENT_VCARD_TYPE);
+ intent.putExtra(Intent.EXTRA_STREAM, uri);
+ getActivity().startActivity(intent);
+ } finally {
+ cursor.close();
+ }
}
}