I was wrong about one point here, so this post is to correct that error.
Sorry.  But now, the plot thickens (maybe)....

On Sun, Apr 29, 2012 at 11:45:34AM -0500, Jim Graham wrote:
> The following code (which works fine earlier in the app on both devices)

I was WRONG about this point!  It does NOT work earlier in the code on my
MB520 phone (Froyo).  I wasn't thinking about the fact that the
PorterDuff merge is in the method that blends filters ... but ONLY if
MORE THAN ONE filter is used.  I re-did that test, using TWO filters,
and it gave me the same force close.  Now I have to wonder if I did the
test the right way before, or did I just apply one filter.....

Just to be sure, I re-did the test on my Acer A500 (ICS), as well.  It,
as it has done all along, worked fine with multiple filters.

I just thought of something:  could this have anything to do with
Eclipse's claim that android.graphics.PorterDuff and a.g.P.Modes are
never used?

> causes a force close (logcat below) on my Froyo phone (Motorola Bravo
> MB520), and works fine on my ICS tablet (Acer Iconia A500):
> 
> ---------------------------  CUT HERE  ---------------------------
> Canvas canvas = new Canvas(saveme);
> Paint paint = new Paint();
> 
> canvas = new Canvas(saveme);
> paint = new Paint();
> canvas.drawBitmap(image, 0, 0, paint);
> // the following is line 1071...the source of the exception/error
> paint.setXfermode(new 
> PorterDuffXfermode(android.graphics.PorterDuff.Mode.ADD));
> canvas.drawBitmap(filter, 0, 0, paint);
> ---------------------------  CUT HERE  ---------------------------
> 
> And here's the error in logcat:
> 
> ---------------------------  CUT HERE  ---------------------------
> D/AndroidRuntime(3550): Shutting down VM
> W/dalvikvm(3550): threadid=1: thread exiting with uncaught exception 
> (group=0x400208b0)
> E/AndroidRuntime(3550): FATAL EXCEPTION: main
> E/AndroidRuntime(3550): java.lang.NoSuchFieldError: 
> android.graphics.PorterDuff$Mode.ADD
> E/AndroidRuntime(3550):    at 
> com.jdgapps.UltraCamPro.UltraCamPro$1.onPictureTaken(UltraCamPro.java:1071)
> E/AndroidRuntime(3550):    at 
> android.hardware.Camera$EventHandler.handleMessage(Camera.java:330)
> E/AndroidRuntime(3550):    at 
> android.os.Handler.dispatchMessage(Handler.java:99)
> E/AndroidRuntime(3550):    at android.os.Looper.loop(Looper.java:143)
> E/AndroidRuntime(3550):    at 
> android.app.ActivityThread.main(ActivityThread.java:4717)
> E/AndroidRuntime(3550):    at java.lang.reflect.Method.invokeNative(Native 
> Method)
> E/AndroidRuntime(3550):    at java.lang.reflect.Method.invoke(Method.java:521)
> E/AndroidRuntime(3550):    at 
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
> E/AndroidRuntime(3550):    at 
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
> E/AndroidRuntime(3550):    at dalvik.system.NativeStart.main(Native Method)
> W/ActivityManager(1321):   Force finishing activity 
> com.jdgapps.UltraCamPro/.UltraCamPro
>  ---------------------------  CUT HERE  ---------------------------
>  
> On my tablet, it doesn't throw an error, and continues on to create the
> final image, save it, and return to the camera preview.  Note that this
> very same Porterduff code works fine earlier in the app (also blending
> two bitmaps---different variable names...only difference), and also WAS
> working at this point previously (before a name change, some unused
> imports removed, two[1] that Eclipse said were unused replaced because
> Eclipse complained when they weren't there after I removed them because
> Eclipse said they weren't used).  Oh, one more change:  Target SDK
> stepped up from Android 3.2.1 to Android 4.0.3, min SDK stayed at Android
> 2.2.1.  Tablet also changed from Android 3.2.1 to 4.0.3.
> 
> Can anyone help explain this mystery?
> 
> Thanks,
>    --jim
> 
> 
> [1] android.graphics.PorterDuff and android.graphics.PorterDuff.Mode
> 
> -- 
> THE SCORE:  ME:  2  CANCER:  0
> 73 DE N5IAL (/4)        | Peter da Silva:  No, try "rm -rf /"
> spooky1...@gmail.com    | Dave Aronson:    As your life flashes before
> < Running FreeBSD 7.0 > |      your eyes, in the unit of time known as an
> ICBM / Hurricane:       |      ohnosecond....     (alt.sysadmin.recovery)
>    30.44406N 86.59909W  |
> 
> Android Apps Listing at http://www.jstrack.org/barcodes.html

-- 
THE SCORE:  ME:  2  CANCER:  0
73 DE N5IAL (/4)            MiSTie #49997      < Running FreeBSD 7.0 >
spooky1...@gmail.com                    ICBM/Hurr.: 30.44406N 86.59909W

                   Saw something on TV about Psych-os.
             Hmmmm, Psych OS.  Perhaps the next freeware OS....   --me

Android Apps Listing at http://www.jstrack.org/barcodes.html

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to