mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Issue 521, avoid an NPE
git-svn-id: https://zxing.googlecode.com/svn/trunk@1552 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
ca1cf153d6
commit
273d2eea97
|
@ -151,6 +151,10 @@ public final class ShareActivity extends Activity {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showTextAsBarcode(String text) {
|
private void showTextAsBarcode(String text) {
|
||||||
|
Log.i(TAG, "Showing text as barcode: " + text);
|
||||||
|
if (text == null) {
|
||||||
|
return; // Show error?
|
||||||
|
}
|
||||||
Intent intent = new Intent(Intents.Encode.ACTION);
|
Intent intent = new Intent(Intents.Encode.ACTION);
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
|
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
|
||||||
intent.putExtra(Intents.Encode.TYPE, Contents.Type.TEXT);
|
intent.putExtra(Intents.Encode.TYPE, Contents.Type.TEXT);
|
||||||
|
@ -167,6 +171,9 @@ public final class ShareActivity extends Activity {
|
||||||
*/
|
*/
|
||||||
private void showContactAsBarcode(Uri contactUri) {
|
private void showContactAsBarcode(Uri contactUri) {
|
||||||
Log.i(TAG, "Showing contact URI as barcode: " + contactUri);
|
Log.i(TAG, "Showing contact URI as barcode: " + contactUri);
|
||||||
|
if (contactUri == null) {
|
||||||
|
return; // Show error?
|
||||||
|
}
|
||||||
ContentResolver resolver = getContentResolver();
|
ContentResolver resolver = getContentResolver();
|
||||||
Cursor contactCursor = resolver.query(contactUri, null, null, null, null);
|
Cursor contactCursor = resolver.query(contactUri, null, null, null, null);
|
||||||
Bundle bundle = new Bundle();
|
Bundle bundle = new Bundle();
|
||||||
|
|
Loading…
Reference in a new issue