How to style a button to look like a spinner

by Steven » Tue, 14 Dec 2010 04:52:26 GMT


Sponsored Links
 I want to create a button that "looks" like a spinner element using
the declarative XML layout approach.

This question was asked in Oct 2009, but I could not find a direct
answer to the following post:



Other Threads

1. How to include a Checkbox in List View

Hi Experts,
I am new to Java as well as Android developement. Please help in the
very fundamental issue.the think is i just want to include checkbox in
Listview.How to do it @ programetical or @ Design time.I am using
eclipse for the dev.  here i extented List Activity.
I am trying the following Code.

public class FrmOrders extends ListActivity
{
ListView listView;
String [] strArray;
@Override
public void onCreate(Bundle bndl)
{
  super.onCreate(bndl);
  setContentView(R.layout.orders);
  DBAdapter dbObj = new DBAdapter(FrmOrders.this);
  try
  {
    dbObj.open();
    Cursor c = dbObj.getAllSalesOrders();
    if (c.moveToFirst())
    {
       int count = c.getCount();
       strArray = new String[count];
       for(int i=0;i<count;i++)
       {
                 strArray[i] = "Customer: "+c.getString(2);
              c.moveToNext();
       }
   }
   dbObj.close();
   listView = (ListView)findViewById(R.id.ListView01);
   listView.setItemsCanFocus(false);
   listView.setChoiceMode(ListView.CHOICE_MODE_SINGLE);
   ArrayAdapter<String> listViewArrayAdapter = new ArrayAdapter<String>
(FrmOrders.this,
      android.R.layout.simple_list_item_multiple_choice, strArray);
   listView.setAdapter(listViewArrayAdapter);
   listView.setTextFilterEnabled(true);
   listView.setOnItemClickListener(new OnItemClickListener()
   {
      public void onItemClick(AdapterView<?> adapterview, View arg1,
                int arg2, long arg3)
      {
          String str = String.valueOf(adapterview.getSelectedItem());
          Toast .makeText(getBaseContext(),String.valueOf(str.length
()),          Toast.LENGTH_LONG).show();
      }
});
}
 catch (Exception e)
{
        Toast .makeText(getBaseContext(),DBAdapter.strException ,
Toast.LENGTH_LONG).show();
        Toast.makeText(getBaseContext(),e.toString(),Toast.LENGTH_LONG).show
();
}
}

Thanks in Advance.
Vamsi

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

2. Help with Gallery Widget

Hello everyone,

I have 2 problems
- I want to scroll gallery to a specific position by calling a
function, but at the same time to see the animation of scrolling. I
have tried the following but they don't seem to do the animation
(although the ):
# public void setSelection(int position, boolean animate) <- it seems
like not using the second parameter
# public void setSelection(int position)
both of the above methods are inherited from android.widget.AbsSpinner

- How can i make Gallery widget circular, so when i scroll to the end
to continue from the beginning. Actually i don't want it to have an
end. Is there any way to do that?

Thanks in advance for your time,
Chris

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

3. Embedding a hyperlink in Intent email body....

4. Problem with startSearch(Google Web Search)

5. Have the Market problems been resolved?

6. Possible bug in Tabs?

7. G2 has twice the flash of the G1 (was Have the Market problems been resolved?)