expandable list view

by google » Tue, 07 Apr 2009 19:39:12 GMT


Sponsored Links
 hi,
i am creating expandable list with group and childs,
i am able to handle onchildclick()
but not able to handle ongroupclick()  can anybody helps in this



regards,
chandra

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



expandable list view

by dillirao malipeddi » Mon, 13 Apr 2009 17:21:26 GMT


 you can use
       @Override
public void onGroupExpand(int groupPosition)
       {
// TODO Auto-generated method stub
super.onGroupExpand(groupPosition);
Toast.makeText(ExpandableList1.this, "Group Clicked on pos =
"+ groupPosition, Toast.LENGTH_SHORT).show();
}

for get selected  group position

i think this will help you








-- 
Dilli Rao. M

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


Sponsored Links


Other Threads

1. reposition a widget programmatically

I am creating a custom widget that is a composition of 3 Buttons. I
want to reposition the buttons as I am doing in my code, however this
doesn't work. Basically I am trying to create a widget that has three
buttons positions somewhere in the middle of the screen.

Any ideas?

My code looks like this:

public class ZoomControl extends LinearLayout {

        private Button zoomIn;
        private Button zoomOut;
        private Button magnify;

        public ZoomControl(Context context) {
                this(context, null);
        }

        public ZoomControl(Context context, AttributeSet attrs) {
                super(context, attrs);
                init(context);
        }

        private void init(Context context) {

        LayoutInflater inflater = (LayoutInflater)
context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        inflater.inflate(R.layout.zoomcontrol, this, true);

        // get handles to views
        zoomIn = (Button) findViewById(R.id.zoomIn);
        zoomOut = (Button) findViewById(R.id.zoomOut);
        magnify = (Button) findViewById(R.id.zoomMagnify);

        // reposition views
        zoomIn.offsetLeftAndRight(200);
        zoomIn.offsetTopAndBottom(200);
        requestLayout();

        }

        public void dispatchDraw(Canvas canvas) {
        }
}



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

2. Can't keep AlertDialog on screen when KeyEvent.KEYCODE_BACK is handled with 1.5 (??)

Hi all,
I've got something simple where I want to raise an AlertDialog after
catching this keypress:

@Override
            public boolean onKeyDown(int keyCode, KeyEvent event){
                super.onKeyDown(keyCode, event);
                switch (keyCode){

                case KeyEvent.KEYCODE_BACK:
                        alertDialog= new AlertDialog.Builder(this).create();
                        alertDialog.setTitle("Option");
                        alertDialog.setMessage("Perform?");
                        alertDialog.setButton("Yes", new 
DialogInterface.OnClickListener
() {
                                public void onClick(DialogInterface dialog, int 
whichButton) {
                                        setResult(RESULT_OK);
                                        finish();
                                }});
                        alertDialog.setButton("No", new 
DialogInterface.OnClickListener
() {
                                public void onClick(DialogInterface dialog, int 
whichButton) {
                                }});
                        alertDialog.show();
                        break;

                default:
                        break;

                }
                        return true;
            }

The interesting thing here is that when you hit the back button, you
*do* see the AlertDialog for a split second, but then you're back at
the previous screen you were at.  Almost as if the system is hellbent
on sending the user back to the previous screen, regardless of what
the developer has constructed around this event.

Anyone else see this behavior?  I'm using 1.5r2 here.  Any help would
be appreciated - I'm pretty sure I'm using this correctly and that
this is a bug.

Thanks
Rob
--~--~---------~--~----~------------~-------~--~----~

3. getFromLocationName always throws IOException first time, but is successful second time with same input

4. PDF version of Android Icon Templates Guidelines

5. ADC 2 Eligibility

6. Cupcake Keyboard Crash in Landscape mode

7. Button ID