How to implement onMeasure() for my custom widget

by silverburgh » Wed, 17 Feb 2010 02:47:34 GMT

Sponsored Links

I am trying to implement my own custom widget, but I am not sure how
to implement the onMeasure() for my custom Widget.

protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

I want to put my custom widget in a linear layout, so that myWidget's
width can fill up the rest of the linear layout after the android
widget on the same LinearLayout :

<LinearLayout xmlns:android="" ;
        xmlns:app="" ;
    <Button android:id="@+id/buttonA"
    android:text="@string/buttonA" />

            app:text="Red some more text and more text etc etc"/>

  <ImageView android:id="@+id/icon"
                android:src="@drawable/icon" />



Other Threads

1. Supported Media Formats


I've been using MediaPlayer for playing some sounds and I've found no
way to get hold of a list of supported mime types at runtime. I was
hoping for something along the lines of MIDP's but there
doesn't seem to be anything that achieves this on Android.
The only thing that there seems to be is a web page that lists
supported media types (at the moment and on the small amount of
devices available).

Does anyone know of a way of enumerating the mime types?



2. How to test Sipdroid using an emulator?

Hello. I have downloaded Sipdroid and I want to test how it works so that I
can learn some of the skills that have been used in its development. The
problem is- I cannot load the program into the Android emulator. While I
know how to create a new folder myself and work with the emulator, how can I
load this program into the emulator? (FYI: I am using emulator within

Please assist...


3. How to prevent app to be removed/uninsalled

4. show and hide the titlebar

5. Mime type on download file

6. SDK USB driver for Vista SP1 won't install - Solution?

7. G1 Firmware in ADP1?