WidgetLayout inside PreferenceActivity displays new then old bitmap...

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

Sponsored Links

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


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


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

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:

But nothing changed...

Can someone help me please ?



Other Threads

1. Activity versus Service threads

After starting a Service (with startService method) the Activity and
the Service are running in the same thread according to
Thread.currentThread().  I suppose if I start another Activity it will
also be running in that same thread.

So that makes me wonder if there are reasons why the Activity cannot
just call methods on the Service directly and vice versa, once you get
references to the two objects.  What is the role of IBinder that is
better than plain object references?

One reason I am asking is that I have application singleton objects
that I plan to share between the Service and the Activity and I'm
trying to be clear on the design options.


2. Show Picasa album of a particular user in the app

Hi All,

I want to show the picasa album of a user in my android app. I have
the username/ password + album id of the album. I have tried
implementing via using gdata library. But i am getting a VerifyError
Exception as soon as i run my code.

Following are the gdata libraries that i included in my project:

1) activation.jar
2) gdata-client-1.0.jar
3) gdata-core-1.0.jar
4) gdata-client-meta-1.0.jar
5) gdata-media-1.0.jar
6) gdata-photos-2.0.jar
7) google-collect-1.0-rc1.jar
8) servlet-api.jar.

I am using eclipse 3.4.2 and Google API's[Android 2.2].

I am getting following exception:

11-03 12:00:16.603: WARN/dalvikvm(1702): Unable to resolve superclass
of Lcom/google/gdata/data/media/MediaMultipart; (1746)
11-03 12:00:16.613: WARN/dalvikvm(1702): Link of class 'Lcom/google/
gdata/data/media/MediaMultipart;' failed
11-03 12:00:16.623: ERROR/dalvikvm(1702): Could not find class
'com.google.gdata.data.media.MediaMultipart', referenced from method
11-03 12:00:16.623: WARN/dalvikvm(1702): VFY: unable to resolve new-
instance 861 (Lcom/google/gdata/data/media/MediaMultipart;) in Lcom/
11-03 12:00:16.623: DEBUG/dalvikvm(1702): VFY: replacing opcode 0x22
at 0x0020
11-03 12:00:16.623: DEBUG/dalvikvm(1702): Making a copy of Lcom/google/
gdata/client/media/MediaService;.insert code (256 bytes)
11-03 12:00:16.633: WARN/dalvikvm(1702): VFY: unable to resolve
exception class 1743 (Ljavax/mail/MessagingException;)
11-03 12:00:16.633: WARN/dalvikvm(1702): VFY: unable to find exception
handler at addr 0x55
11-03 12:00:16.633: WARN/dalvikvm(1702): VFY:  rejected Lcom/google/
gdata/client/media/MediaService;.insert (Ljava/net/URL;Lcom/google/
11-03 12:00:16.643: WARN/dalvikvm(1702): VFY:  rejecting opcode 0x0d
at 0x0055
11-03 12:00:16.643: WARN/dalvikvm(1702): VFY:  rejected Lcom/google/
gdata/client/media/MediaService;.insert (Ljava/net/URL;Lcom/google/
11-03 12:00:16.643: WARN/dalvikvm(1702): Verifier rejected class Lcom/
11-03 12:00:16.653: DEBUG/AndroidRuntime(1702): Shutting down VM
11-03 12:00:16.653: WARN/dalvikvm(1702): threadid=3: thread exiting
with uncaught exception (group=0x4001b188)
11-03 12:00:16.663: ERROR/AndroidRuntime(1702): Uncaught handler:
thread main exiting due to uncaught exception
11-03 12:00:16.693: ERROR/AndroidRuntime(1702): java.lang.VerifyError:
11-03 12:00:16.693: ERROR/AndroidRuntime(1702):     at
11-03 12:00:16.693: ERROR/AndroidRuntime(1702):     at
11-03 12:00:16.693: ERROR/AndroidRuntime(1702):     at
11-03 12:00:16.693: ERROR/AndroidRuntime(1702):     at
11-03 12:00:16.693: ERROR/AndroidRuntime(1702):     at
11-03 12:00:16.693: ERROR/AndroidRuntime(1702):     at
11-03 12:00:16.693: ERROR/AndroidRuntime(1702):     at
11-03 12:00:16.693: ERROR/AndroidRuntime(1702):     at
11-03 12:00:16.693: ERROR/AndroidRuntime(1702):     at
11-03 12:00:16.693: ERROR/AndroidRuntime(1702):     at
java.lang.reflect.Method.invokeNative(Native Method)
11-03 12:00:16.693: ERROR/AndroidRuntime(1702):     at
11-03 12:00:16.693: ERROR/AndroidRuntime(1702):     at
11-03 12:00:16.693: ERROR/AndroidRuntime(1702):     at
11-03 12:00:16.693: ERROR/AndroidRuntime(1702):     at
dalvik.system.NativeStart.main(Native Method)

My question is: is it possible to do this on android? If yes, then how
do i do that? Am i missing some library or some other thing.

OR if it is not possible, can you guys point to me on these pages?



3. LG Optimus and the Rise of the Cheap Androids!

4. Listen/bind a hardwarebutton to a activity/event

5. Can not update app on the Market now

6. Android: DeadObjectException for InputMethodService (SoftKeyboard API sample)

7. How to pass a Context variable from one Activity to another ?