How can I specify the default style of my widget

by Meryl Silverburgh » Fri, 13 Feb 2009 08:16:16 GMT


Sponsored Links
 Hi,

I create my own widget with its own drawable for background.

So in my styles.xml file, I have this:
<resources>
      <style name="MyWidget">
        <item name="android:background">@drawable/btn_mywidget_bg</item>
    </style>
</resources>

In my main.xml, if i specified my 'style' attribute, my background
drawable was displayed correctly.
 <test.MyWidget android:id="@+id/mywidget" style="@style/MyWidget" />

but if I just do this:
<test.MyWidget android:id="@+id/mywidget" /> , the background drawable
is not display correctly.

Can you please tell me how can I specify the default style of my
widget so that I don't need to add style="@style/MyWidget" everytime I
 use my widget?

Thank you.

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



Other Threads

1. Problem with Log Cat(log is empty)

Hi

I am using Android SDK 1.1
when i run or debug the application i am getting empty list
it showing empty not show any log details

what is the prob?

any ideas regarding this ?
thanks in advance
--~--~---------~--~----~------------~-------~--~----~

2. AudioManagaer 's setMode()

AudioManager am=(AudioManager)getSystemService(AUDIO_SERVICE);
            am.setSpeakerphoneOn(true);
            am.setMode(AudioManager.MODE_IN_CALL);

           //Log.e(tag, msg)
                mMediaPlayer = MediaPlayer.create(this, R.raw.ek);
            mMediaPlayer.start();



Hello,

I am receiving incoming call and i want to play the sound so i want
that the caller can listen it on other side. So i am using the
AudioManager's setMode(AudioManger.MODE_IN_CALL)

But yet it is not working as caller is not able to listen it.  so can
some one tell me what is wrong in it ?

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

3. launch application through adb

4. Integrating with Google Docs

5. Problem playing aac file using my own aac decoder

6. How to build a static executable using android tool chain?

7. One click Run App