WidgetLayout inside PreferenceActivity displays new then old bitmap...

by Seb » Sat, 24 Oct 2009 00:01:46 GMT


Sponsored Links
 Hi,

I have a PreferenceActivity designed with a .xml file
Inside the .xml, I have:

...
    <Preference
      android:key="picture"
      android:title="Picture"
      android:widgetLayout="@layout/picture"
    />
...

The widgetLayout xml file is a linearlayout with a ImageView inside.
I have set a default drawable src attribute to the ImageView:

android:src="@drawable/test"


When launching, the PreferenceActivity is displayed. The test drawable
as well. Everything is ok.

When I click on the Preference, I have specify to modify the bitmap
inside this widgetLayout as following:

ImageView img = (ImageView) findViewById(R.id.picture_img);
img.setImageBitmap(null);
System.gc();
img.setImageBitmap(newBitmap);


The newBitmap is then well displayed inside the widgetLayout.
I scroll the Preference list (and hide the line that own the
widgetLayout) and then scrolling back to make the line reappear.
Then, the old bitmap is displayed ("@drawable/test")  -----> KO, it
should still display the new bitmap.

I tried to add:
getListView().destroyDrawingCache();
img.invalidate();

But nothing changed...

Can someone help me please ?

Thanks,
Seb.

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Debug Keystore Password Wrong? HELP!!!

If i can get any help it would be great.  I am trying to just run the
debug mode with the keytool and i enter the Keystore password from
Android which is "android" and it tells me that the password is
wrong.  What Do i do about this problem so i can get the MD5
fingerprint in order to get my API key for the google map for debug
mode.  Any help would be greatly appreciated as i get to where it asks
for the password and apparently android doesn't work anymore.

-- 

2. GpsStatusListener: no satellites used in fix although status is GpsStatus.GPS_EVENT_FIRST_FIX

I added a gps status listener to my location manager in order see when I 
get the first fix.


When I receive the GPS_EVENT_FIRST_FIX I then loop through all the satellites, but why is none of them used in the fix? (usedInFix()). My log says 'false' for all satellites? final class GpsStatusListener implements GpsStatus.Listener { public void onGpsStatusChanged(int i) { if (i==GpsStatus.GPS_EVENT_FIRST_FIX) { Log.d(APP, "gpsx.fixed."); for (GpsSatellite sat:locationManager.getGpsStatus(null).getSatellites()) { Log.d(APP, "gpsx.GpsStatus.Sat.fixed: " + sat.usedInFix()); } } } } Log output: gpsx.fixed. gpsx.GpsStatus.Sat.fixed: false gpsx.GpsStatus.Sat.fixed: false gpsx.GpsStatus.Sat.fixed: false --

3. Uploading files on servlet

4. Acara Indosat di Pontianak mengenai Androi

5. no such table: local_network: , while compiling: SELECT _id, network, url FROM local_network

6. Receiving UDP Broadcasts

7. signing bootloader/kernel using the openss comman