Re: ImageView setColorFilter, what to do for a bitmap?

by Tim Jones » Sun, 03 Apr 2011 01:54:04 GMT

Sponsored Links
 You can create a new scratch bitmap with a copy of the data and then blt it 
back onto the target bitmap like so:

Paint p = new Paint();

 Canvas c = new Canvas(target);
c.drawBitmap(scratchBitmap, 0, 0, p);


Other Threads

1. has stopped unexpectedly


when starting up the android, i get the error message window
"the process has stopped unexpectedly. please
try again"

when I click "Force close" and step into Media Scanner, I get the
" Send Action_media_mounted to trigger the media scanner"

How can I resolve this problem?


2. Force Close on startActivityForResult since 1.5 update on phones but not emulator

Hi Tom,

Emulators are great for "happy path" testing, meaning they quickly
allow you to test your program without a real device.  But don't
confuse this for how your users are gonna thrash your game on a real
phone in their real worlds.  :)

A couple of things you won't be able test very well on an emulator:

1) Orientation changes
Changing the phone's orientation destroys and recreates the currently
displayed view.  Your users will change orientations at will when they
need to type something (at least prior to the 1.5 on screen
keyboard.)  If your app is in the foreground, this destroys your
current activity and creates a new one.

2) Low Memory Conditions
The Android Java VM will do whatever it can to keep the foreground
process (the one with the UI focus) responsive.  To this end, it will
need to start freeing up resources from other apps when needed, and,
in rare instances, will kill background apps.  This is where I ran
into most of my problems with my game.  I didn't account for users
doing normal things like bringing an app up, using it for a bit,
pressing the home button, going somewhere else, maybe even putting
their phone to sleep for a while and then coming back to your app
later.  You'll need to plan for this!  If you haven't already done so,
study this backwards and forwards and memorize it:

3) Forcing Android to terminate your app and relaunch it (yes, Android
really does do this sometimes)
Do you have any background threads running that assume certain
resources are around that may have been cleaned up while your app was
in the background?  Make sure that all the code you need to initialize
your app gets properly called in the case where your app gets killed,
but Android launches the activity that was last on the top of the

Hope this helps,

- Mike

3. A question on Intents.

4. How to send an intent from command line?

5. How to get bitmap infomation before decode an image file?

6. Display a simple alert message in Android 1.5

7. SIGSEGV during Android startup