Why does getPadding() of NinePatchDrawable throw a NullPointerException?

by Romain Guy » Tue, 13 Oct 2009 06:02:16 GMT


Sponsored Links
 NinePatchDrawable tagBalloon9pDrawable = new NinePatchDrawable(tagBalloon9p);

this creates a NinePatchDrawable with a null padding. That's why you
get an NPE. You need to specify the padding.






-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

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



Why does getPadding() of NinePatchDrawable throw a NullPointerException?

by Romain Guy » Tue, 13 Oct 2009 06:02:56 GMT


 BTW, why are you creating the NinePatchDrawable yourself if you are
creating it from a resource anyway?







-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

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


Sponsored Links


Other Threads

1. how to integrate s/w codec like h/w codec (omx plugin) into stagefright

hi group,
       recently, I'm working on integrating omx codec into stagefright in
froyo, and have done some research on h/w integration.
before starting the h/w integration work, i want to integrate s/w codec just
as the h/w way, then i can verify my ideas on h/w integration.

 here is my understanding of h/w integration:

the stack structure from stagefrightplayer to h/w
      ---------------------------------------------
               stagefrightplayer                          wrapper of
awesomeplayer, called by mediaplayerservice
       --------------------------------------------
                awesomeplayer                          player engine,
control all the player flow
      ---------------------------------------------
                        IOMX                                   interface to
call standard openmax interface, used in OMXCodec
      =========================
              OpenMAX IL interface                 openmax standard
interface and omx core
      ---------------------------------------------
             OMX IL implementation                vendor's omx plugin:
including omx core and omx component implementation
      =========================
        API to call underly media driver        API to be called by
different omx components(h264, mpeg4, h263 etc) to operate driver
      ---------------------------------------------
             Media Driver & Firmware              driver to response
up-layer API's call, driver call firmware (such as h264 fw) to decoding
      ---------------------------------------------
                      Hardware                               run according
to driver's instructions
      ---------------------------------------------

      so if the vendors want to integrate their own h/w codec, they should
implement OMX IL(core, component), API to call underlying media driver,
media driver & firmware according to their hardware, while the upper layers
are implement by android.

some description to "API to call underly media driver":
     -> provide simple interface to init/deinit, get/set config, get/set
params, get/set buffer, execute media driver
     -> different codec types are transferred by predefined data structure,
that determine which codec's firmware to be called by driver

if there are some problems in my words pls tell me.


      assume i have implemented the "OMX IL implementation" section above
with h/w integration way, i want to implement s/w codec to be called by the
"OMX IL implementation" section, so that to verify my design of h/w
integration scheme. that is to wrapper s/w codec as  APIs to be called by
 "OMX IL implementation", and my question is:

1. is my h/w integration scheme right? and what is the optimal one?
2. does the method of using s/w codec to verify h/w codec integration
correct? and how to?
3. can anyone tell me details about sections below "OpenMAX IL interface" in
above stack structure? especially how to define the    "API to call underly
media driver"

-- 

2. Masih bingung pilih HH

selamat morning,,
para Suhu & Suhi, mau minta saran, moto xt720 ato galaxy ace ato
wildfire ato defy? Ato miley? Mending ambil mana ya?
Terima kasih....


-dikirimdariZN5-

-- 
===============

3. Menu button/icon not showing up in Honeycomb

4. how to get focus on listview

5. Permintaan maaf dan Klarifikasi terhadap SurveyKuesioner Penelitian

6. Menu/Action Bar bug(?) in Honeycomb

7. Widgets installed by default on Home Screen