Reputation: 2535
i want to click my spinner and take actions just as similar taken by clicking any button , but a dialog is always shown onspinner click, my code is:
final View.OnTouchListener sp = new View.OnTouchListener() {
public boolean onTouch1(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_UP) {
list(); //function to call
}
return true;
}
@Override
public boolean onTouch(View arg0, MotionEvent arg1) {
// TODO Auto-generated method stub
list(); /function to call
return true;
}
};
Upvotes: 0
Views: 585
Reputation: 73721
spinners dont have the ability to do what you want.
what you can do however is create a textview/button
with a spinner style so that it looks like a spinner using
style="@android:style/Widget.Holo.Light.Spinner"
then just put an onClick
listener to that textview and do whatever you want on the click
Upvotes: 2