nits.kk
nits.kk

Reputation: 5316

List item having button

I am working on Android application.
I have a ListView. One of the item has a button, and others have simple text views. I have now requirement of showing button as pressed when it is pressed. I am able to do this.
But when I connect the device via. Bluetooth keyboard and navigate through the list. I see list items being selected as expected.
But I want the item with the button to look as if button has been selected (focused).

Thanks Krishna

Upvotes: 0

Views: 104

Answers (1)

Anchit Mittal
Anchit Mittal

Reputation: 3426

use

list.setOnItemSelectedListener(new OnItemSelectedListener() {

            @Override
            public void onItemSelected(AdapterView<?> arg0, View arg1,
                    int arg2, long arg3) {

                // TODO Auto-generated method stub

            }

            @Override
            public void onNothingSelected(AdapterView<?> arg0) {
                // TODO Auto-generated method stub

            }
        });

Upvotes: 1

Related Questions