AviaryInc/Mobile-Feather-SDK-for-Android — Issue #10: Bug in DownloadImageAsyncTask
Author: Goddchen
Created: 2012-01-26 12:55:03+00:00
State: open

Providing a HTTP uri when launch the AviaryFeather intent will throw an exception on the latest version.

01-26 12:30:48.175: E/AndroidRuntime(18718): java.lang.IllegalArgumentException: attributes cannot contain null values
01-26 12:30:48.175: E/AndroidRuntime(18718): at com.aviary.android.feather.library.tracking.LocalyticsSession.tagEvent(LocalyticsSession.java:414)
01-26 12:30:48.175: E/AndroidRuntime(18718): at com.aviary.android.feather.library.tracking.Tracker.recordTag(Tracker.java:45)
01-26 12:30:48.175: E/AndroidRuntime(18718): at com.aviary.android.feather.FeatherActivity.onImageSize(FeatherActivity.java:1345)
01-26 12:30:48.175: E/AndroidRuntime(18718): at com.aviary.android.feather.async_tasks.DownloadImageAsyncTask.onPostExecute(DownloadImageAsyncTask.java:157)
01-26 12:30:48.175: E/AndroidRuntime(18718): at com.aviary.android.feather.async_tasks.DownloadImageAsyncTask.onPostExecute(DownloadImageAsyncTask.java:1)
01-26 12:30:48.175: E/AndroidRuntime(18718): at android.os.AsyncTask.finish(AsyncTask.java:602)
01-26 12:30:48.175: E/AndroidRuntime(18718): at android.os.AsyncTask.access$600(AsyncTask.java:156)
01-26 12:30:48.175: E/AndroidRuntime(18718): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:615)
01-26 12:30:48.175: E/AndroidRuntime(18718): at android.os.Handler.dispatchMessage(Handler.java:99)
01-26 12:30:48.175: E/AndroidRuntime(18718): at android.os.Looper.loop(Looper.java:137)
01-26 12:30:48.175: E/AndroidRuntime(18718): at android.app.ActivityThread.main(ActivityThread.java:4424)
01-26 12:30:48.175: E/AndroidRuntime(18718): at java.lang.reflect.Method.invokeNative(Native Method)
01-26 12:30:48.175: E/AndroidRuntime(18718): at java.lang.reflect.Method.invoke(Method.java:511)
01-26 12:30:48.175: E/AndroidRuntime(18718): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
01-26 12:30:48.175: E/AndroidRuntime(18718): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
01-26 12:30:48.175: E/AndroidRuntime(18718): at dalvik.system.NativeStart.main(Native Method)

I fixed it by simply implementing the following fix:

onPostExecute(Bitmap result) {
...
if (mSizeListener != null && result != null) {
if (mImageSize.getOriginalSize() == null) {
mImageSize.setOriginalSize(mImageSize.getNewSize());
}
mSizeListener.onImageSize(mImageSize.getOriginalSize(),
mImageSize.getNewSize(), mImageSize.getBucketSize());
}
...
}