This maybe a problem with painting itself.

On Sep 17, 7:34 am, EmilDiego <emildi...@gmail.com> wrote:
> I am working on a Live Wallpaper app.  Basically id downloads a bunch
> of different background images and then randomly picks one to
> display.  They change every few minutes to another background.  THe
> problem I an encountering is during the transitions.  The bitmaps
> sometimes flickers when transitioning to the new one.
>
> I have a thread class that does the drawing for me and while i swap
> the bitmaps i pause the drawing thread but I still get the flicker.
> Here's some of the code.  I'm not sure what else I need to do.  Any
> suggestions would be great.  Thanks.
>
> //* we don't want to paint the background while we are loading the
>                 //* new image into it so lets pause the drawing then restart
>                 //* it after were done.
>                 this.pausePainting();
>
>                 xTmpBitmap = BitmapFactory.decodeStream(ifp.getInputStream());
>                 if (xTmpBitmap == null)
>                 {
>                         LiveWallpaper1.debugLog.log_error("Unable to create 
> the bitmap,");
>                         ifp.close();
>
>                         //* if we fail for some reason we need to restart the 
> painting
>                         this.resumePainting();
>                         return false;
>                 }
>                 //* get a reference to the new bitmap
>                 this.m_xBitmap = xTmpBitmap;
>                 xTmpBitmap =  null;
>
>                 //* resume the painting
>                 this.resumePainting();

-- 
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