diff --git a/~$$顺序图.~vsdx b/~$$顺序图.~vsdx deleted file mode 100644 index 9756b0f..0000000 Binary files a/~$$顺序图.~vsdx and /dev/null differ diff --git a/代码/在这里3.0/bin/classes/com/stone/util/Util$1.class b/代码/在这里3.0/bin/classes/com/stone/util/Util$1.class index 97c3472..e1c38f2 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/util/Util$1.class and b/代码/在这里3.0/bin/classes/com/stone/util/Util$1.class differ diff --git a/代码/在这里3.0/bin/classes/com/stone/util/Util.class b/代码/在这里3.0/bin/classes/com/stone/util/Util.class index ed1adf0..0b125ae 100644 Binary files a/代码/在这里3.0/bin/classes/com/stone/util/Util.class and b/代码/在这里3.0/bin/classes/com/stone/util/Util.class differ diff --git a/代码/在这里3.0/src/com/stone/util/Util.java b/代码/在这里3.0/src/com/stone/util/Util.java index 854f733..bb6f120 100644 --- a/代码/在这里3.0/src/com/stone/util/Util.java +++ b/代码/在这里3.0/src/com/stone/util/Util.java @@ -117,8 +117,9 @@ private static final String TAG = "SDK_Sample.Util"; * @return byte[] */ public static byte[] hexStringToBytes(String hexString) { + byte[] nullreplace=null; if (hexString == null || "".equals(hexString)) { - return null; + return nullreplace; } hexString = hexString.toUpperCase(); int length = hexString.length() / 2; @@ -373,15 +374,19 @@ private static final String TAG = "SDK_Sample.Util"; Bitmap bitmap = BitmapFactory.decodeStream(stream , null, opts); return bitmap; } catch (OutOfMemoryError e) { + Logger logger = Logger.getLogger("lavasoft"); + logger.log(Level.SEVERE, "sthwrong", e); return null; } catch (Exception e) { + Logger logger = Logger.getLogger("lavasoft"); + logger.log(Level.SEVERE, "sthwrong", e); return null; } } private static final int MAX_DECODE_PICTURE_SIZE = 1920 * 1440; public static Bitmap extractThumbNail(final String path, final int height, final int width, final boolean crop) { - Assert.assertTrue(path != null && !path.equals("") && height > 0 && width > 0); + Assert.assertTrue(path != null && !"".equals(path) && height > 0 && width > 0); BitmapFactory.Options options = new BitmapFactory.Options(); @@ -392,7 +397,6 @@ private static final String TAG = "SDK_Sample.Util"; tmp.recycle(); tmp = null; } - Log.d(TAG, "extractThumbNail: round=" + width + "x" + height + ", crop=" + crop); final double beY = options.outHeight * 1.0 / height; final double beX = options.outWidth * 1.0 / width; @@ -453,6 +457,8 @@ private static final String TAG = "SDK_Sample.Util"; } catch (final OutOfMemoryError e) { Log.e(TAG, "decode bitmap failed: " + e.getMessage()); + Logger logger = Logger.getLogger("lavasoft"); + logger.log(Level.SEVERE, "sthwrong", e); options = null; } @@ -461,7 +467,8 @@ private static final String TAG = "SDK_Sample.Util"; public static final void showResultDialog(Context context, String msg, String title) { - if(msg == null) return; + if(msg == null) + return; String rmsg = msg.replace(",", "\n"); Log.d("Util", rmsg); new AlertDialog.Builder(context).setTitle(title).setMessage(rmsg) @@ -480,17 +487,13 @@ private static final String TAG = "SDK_Sample.Util"; mProgressDialog = ProgressDialog.show(context, title, message); } - public static AlertDialog showConfirmCancelDialog(Context context, - String title, String message, - DialogInterface.OnClickListener posListener) { - AlertDialog dlg = new AlertDialog.Builder(context).setMessage(message) - .setPositiveButton("确认", posListener) - .setNegativeButton("取消", null).create(); + public static AlertDialog showConfirmCancelDialog(Context context,String message,DialogInterface.OnClickListener posListener) + { + AlertDialog dlg = new AlertDialog.Builder(context).setMessage(message).setPositiveButton("确认", posListener).setNegativeButton("取消", null).create(); dlg.setCanceledOnTouchOutside(false); dlg.show(); return dlg; } - public static final void dismissDialog() { if (mProgressDialog != null) { mProgressDialog.dismiss(); @@ -518,7 +521,6 @@ private static final String TAG = "SDK_Sample.Util"; activity.runOnUiThread(new Runnable() { @Override public void run() { - // TODO Auto-generated method stub if (mToast != null) { mToast.cancel(); mToast = null; @@ -565,10 +567,12 @@ private static final String TAG = "SDK_Sample.Util"; Log.v(TAG, "image download finished." + imageUri); } catch (OutOfMemoryError e) { - e.printStackTrace(); + Logger logger = Logger.getLogger("lavasoft"); + logger.log(Level.SEVERE, "sthwrong", e); bitmap = null; } catch (IOException e) { - e.printStackTrace(); + Logger logger = Logger.getLogger("lavasoft"); + logger.log(Level.SEVERE, "sthwrong", e); Log.v(TAG, "getbitmap bmp fail---"); bitmap = null; } @@ -585,8 +589,8 @@ private static final String TAG = "SDK_Sample.Util"; // =兼容android 5.0 // ========== - public static String ACTION_OPEN_DOCUMENT = "android.intent.action.OPEN_DOCUMENT"; - public static int Build_VERSION_KITKAT = 19; + public static final String ACTION_OPEN_DOCUMENT = "android.intent.action.OPEN_DOCUMENT"; + public static final int Build_VERSION_KITKAT = 19; public static String getPath(final Context context, final Uri uri) { final boolean isKitKat = Build.VERSION.SDK_INT >= 19;