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. Handset recommendation for outdoor use (screen readability)?

I have a client that envisions to use Android handsets for an outdoor
data acquisition effort. I'd like to recommend the NexusOne (for a
variety of reason), but the show stopper to me is the AMOLED screen
that just doesn't perform outdoors. I'd expect that field staff would
be miserable pretty fast.
Anybody have specific experience in that area and recommendations for
US sourceable, side-loadable handsets?
JP

-- 

2. is there any API available to receive the broadcast receiver for app started.

Hi All,

I have one question.

I want to receive a broadcast receiver whenever any app is started.

for example:
I have an app which has the broadcast receiver which listens for the
app started event .

I installed this app on the device.

Now I have opened the Phone or Contacts app. Now my app which is
listening for this kind of event(app opened or started) has to be
invoked.

can any one tell me the solution?

Thanks,
Manoj.

-- 

3. Run AsyncTask from a non-ui Thread

4. How to get the Android OS version using adb

5. Corporate Email Closes Randomly

6. Access to databases from native code (for example mmssms.db)

7. Howto integrate 3rd party app to tabhost