[android-developers] List with expandable

2012-03-04 Thread Jagadeesh
Hi
 i have done with listactvity in my application ,now i need expand
when clicks and for each item
and again click on expandble list items should be back in same screen.
can you please guide me any one about this


///

package com.android.samplelisy;


import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ListView;

public class samplelist extends ListActivity {
String[] values = new String[] { Application, product,
Sabicproduct };
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);


// Use your own layout
ArrayAdapterString adapter = new ArrayAdapterString(this,
R.layout.main, R.id.label, values);
setListAdapter(adapter);
}




  @Override
  protected void onListItemClick(ListView l, View v, int position, long 
id)
  {
  String item = (String)
 getListAdapter().getItem(position);

  switch (position) {
  case 0:
  l.setOnItemClickListener(new 
AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView? av, 
View v, int pos, long id) {
   // onListItemClick(v,pos,id);

}

private void onListItemClick(View v, 
int pos, long id) {
// TODO Auto-generated method 
stub

}
});

  break; case 1:

break;

 }
  }


}

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=enattachment: device.png

[android-developers] List and Expandable List Combo

2008-12-27 Thread mscwd01

Is there a way to have a list view which comprises both expandable
lists and normal rows?

I.e.

List
   - Row 1
   - Row 2
   - Row 3
  - Row 3 Child 1
   - Row 4
   - Row 4 Child 1
   - Row 4 Child 2
   - Row 5

E.g. Row 1, 2 and 5 are simple rows, maybe just TextViews, and Rows 3
and 4 are expandable lists which themselves comprises of simple rows.

I tried creating an expandable list where some parent rows are
assigned no children - but this generates exceptions...

Any ideas?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---