there s a class called ExpandableListView used to do what you want, still i
think you ll have to use a simple activity and declare it as a part of the
layout to be displayed
http://developer.android.com/reference/android/widget/ExpandableListView.html
Le dimanche 4 mars 2012 17:54:51 UTC+1, Jagadeesh a écrit :
>
> 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
> ArrayAdapter<String> adapter = new
> ArrayAdapter<String>(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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en