2

I have a widget which contains 5 buttons. How can I implement such a behavior for a button when it is clicked, an expandable panel under the widget appears with more buttons? And if another button is clicked another panel appears...

So my initial widget layout looks like this:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/LinearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >

<Button
    android:id="@+id/button1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Button" 
    android:background="@drawable/smc_icon"
    android:textColor="#FFFFFF"
    />

<Button
    android:id="@+id/button2"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Button" 
    android:background="@drawable/smc_icon"
    android:textColor="#FFFFFF"
    />

<Button
    android:id="@+id/button3"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Button" 
    android:background="@drawable/smc_icon"
    android:textColor="#FFFFFF"
    />

<Button
    android:id="@+id/button4"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Button" 
    android:background="@drawable/smc_icon"
    android:textColor="#FFFFFF"
    />

<Button
    android:id="@+id/button5"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Button" 
    android:background="@drawable/smc_icon"
    android:textColor="#FFFFFF"
    />

Another question: Can I implement such an activity which renders as many buttons as I define in a resource xml file?

Reechee
  • 23
  • 5
  • This might be what your looking for http://stackoverflow.com/questions/8312344/how-to-add-a-dropdown-item-on-the-action-bar – Aiden Strydom Mar 12 '13 at 13:36

0 Answers0