title: listview with button and call the previous step after clicking
body: <p>I'm new to android development. I have 2 <code>ListView</code>s. when I click on one item on the first <code>ListView</code>, the new dataset will show in the second one. I have added a <code>Button</code> to the second <code>ListView</code> (<code>onItemClick</code>). Using an <code>Adapter</code>. So when I click on the <code>Button</code> (Read more) it will load a new <code>Activity</code>. So when I click on the <code>Back</code> <code>Button</code> i need to load the same data(listview2) in my previous step.</p>
  
  <pre><code>int images[] ={R.drawable.boc, R.drawable.commercial, R.drawable.nations, R.drawable.popls};
  
      adp = new ItemsAdapter(getActivity(), images);
      menu.setAdapter(adp);
  
      menu.setOnItemClickListener(new OnItemClickListener() {
  
          @Override
          public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,
                  long arg3) {
              // TODO Auto-generated method stub
              TextView tv2 = (TextView) v.findViewById(R.id.listViewText);
              /*ImageButton imgbtn = (ImageButton) v.findViewById(R.id.AddButton);
              ImageButton imgbtn2 = (ImageButton) v.findViewById(R.id.AddInfo);
              */
  
  
              switch (arg2) {
              case 0:
                  ListAdapter adapter3 = new ListAdapter(getActivity(), boc) ;
                  menu2.setAdapter(adapter3);
  
  
                  break;
              case 1:
                  // menu2.setAdapter(new ArrayAdapter&lt;String&gt;(this,
                  // android.R.layout.simple_list_item_1,subitems2));
                  ListAdapter adapter4 = new ListAdapter(getActivity(), bankcrcards) ;
                  menu2.setAdapter(adapter4);
                  break;
  
              default:
                  break;
              }
  
          }
      });
  
      menu2.setOnItemClickListener(new OnItemClickListener() {
  
          @Override
          public void onItemClick(AdapterView&lt;?&gt; arg0, View arg1, int arg2,
                  long arg3) {
              // TODO Auto-generated method stub
              ImageView imgbtn1 = (ImageView) arg1.findViewById(R.id.imageView2);
              imgbtn1.setOnClickListener(new View.OnClickListener() {
  
                  @Override
                  public void onClick(View v) {
                      // TODO Auto-generated method stub
                      Toast.makeText(getActivity(), "error", Toast.LENGTH_SHORT).show();
                      expandableListView=new ExpandableListFragment();
                      FragmentTransaction transaction=getFragmentManager().beginTransaction();
                      transaction.setCustomAnimations( R.anim.fade_in, R.anim.fade_out);
                      transaction.replace(R.id.myFragement,expandableListView);
                      transaction.addToBackStack(null);
                      transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
                      transaction.commit();
                  }
              });
  
          }
      });
  </code></pre>