is it possible to reference custom drawable from layout file?

by skink » Sun, 08 Nov 2009 06:33:17 GMT

Sponsored Links

i heard somewhere that if i have custom drawable (class extending
Drawable), starting from donut 1.6 it will be possible to reference it
directly from layout file, something like this:


is it true? and if so, what is an exact syntax of that reference?



Other Threads

1. Navigating between screens


I am new to Android development (and new to Java) and am trying to get
my head around how to structure the code for an app.

The app I have in mind requires several set-up and informational
screens leading to a round of arcade gameplay, then back to the set-up
and information screens and so it continues.

Starting with the set-up part. I'd like an initial screen with a
number of buttons, each of which launch a secondary screen, where data
can be viewed/entered. Each secondary screen has a 'back' button to
save the entered data and return the user to the initial screen.

Is it best to have a separate activity for the initial and each
secondary screen and use startActivity on each initial screen button
and secondary screen back button to navigate between them?
Note: I only intend having a single depth of secondary screen so this
simple navigation will be enough
What about startActivityForResult? would that be better? if so, why

- Frink

P.S. I have loads more questions but thought it best to start with
this one. If I'm missing something then please let me know!


2. Jni To Java BLock THe UI thread.

I am sure This has been asked a bunch of times. And I did look around
before posting here but could not find exactly an answer.

I have 2 threads running. One, the activity itself (UI thread), the
other is the networking logic implemented in C.
Second thread is also created in Java not with p_threads or anything.
So I create the second thread and call a C function which does the
networking and Loops and Loops and Loops.

During this loop in C " in case of an error"  I would like to
"callback" the java UI thread and pop up a dialog from C , the KEY is
C has to block and wait.
So if I create a thread and set up a handler in Java to show the
DIalog the the native C code won't block. I have also looked in to
Loopers Thinking that it could be helpful to block the C code.

Now of course I could be naive and write a while(wait) in c and as
soon as dialog is closed I can make a native call from java and set
the wait to false.
But that is just not cool.

Any help is appreciated.



3. Is android 2.2 emulator support any flash or flash lite?

4. hi, i'm newbie in android, i wonder about float dp...

5. unimplement glGetFloatv()

6. another password field appears when switching orientation while editing the field

7. jni armeabi code compatibility