How to implement onMeasure() for my custom widget

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


Sponsored Links
 Hi,

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=" http://schemas.android.com/apk/res/android" ;
        xmlns:app=" http://schemas.android.com/apk/res/com.tmobile.socialhub" ;
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    <Button android:id="@+id/buttonA"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/buttonA" />

    <com.mycompany.MyWidget
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
           android:layout_weight="1"
            app:text="Red some more text and more text etc etc"/>

  <ImageView android:id="@+id/icon"
            android:layout_width="wrap_content"
                android:layout_height="fill_parent"
                android:src="@drawable/icon" />

</LinearLayout>

--



Other Threads

1. upgrade android di ubunt

iya nih juragan... ane pengen upgrade spica ke 2.1, sayangnya ane gak
mampu beli windows asli yang harganya 1.5 jt-an itu (gaji gw aja gak
sampe segitu). jadinya lepi ane pake ubuntu. banyak yang bilangpake
odin multi-downloader, tapi sayangnya cuma ada exe-nya doank, gak ada
yang versi .bin .deb atau at least tar.gz dah (biarlah gw compile
sendiri). bahkan pc suite samsung ajah gak tersedia buat linux.
diskriminasi orang kere nih. mohon info-nya kalo ada cara untuk
upgrade di linux

-- 
"Indonesian Android Community [id-android]" 

2. Problem - How to copy .apk to /system/app ???

You should download a file manager to browse the SDCard and install the APK
or (since it's on VMWare) install an Apache server on your host machine and
use it to install any APK through Android's Internet Browser.








> > 

3. Problem - How to copy .apk to /system/app ???

4. How to unregister listener after application get closed

5. system reboot - How to get the crash dump.

6. about get cid

7. Live report from Shenzhen