title: Android :How to perform Next/Previous data details from listview items
body: <p>i wanna show the details data from listviews android, i did it... but the problem is, i don't know how to make a function to show the next/previous detail data by clicking the next/previous button based on listview data.</p>
  
  <p>this is my first activity</p>
  
  <pre><code>    String[] values = new String[] { "Android Example ListActivity", "Adapter implementation", "Simple List View With ListActivity",
            "ListActivity Android", "Android Example", "ListActivity Source Code", "ListView ListActivity Array Adapter", "Android Example ListActivity" };
      // Binding Array to ListAdapter
      this.setListAdapter(new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, R.id.label, values));
  
      ListView lv = getListView();
  
      // listening to single list item on click
      lv.setOnItemClickListener(new OnItemClickListener() {
        public void onItemClick(AdapterView&lt;?&gt; parent, View view,
            int position, long id) {
  
            // selected item 
            String product = ((TextView) view).getText().toString();
  
            // Launching new Activity on selecting single List Item
            Intent intent = new Intent(getApplicationContext(), SingleListItem.class);
            // sending data to new activity
            intent .putExtra("product", product);
            intent.putExtra("pos",position);
            startActivity(intent);
        }
      });
  }
  </code></pre>
  
  <p>}</p>
  
  <p>this is my second  activity where i have detail i want to put two button next and previous from these two button i want to handle my listview data</p>
  
  <pre><code>    TextView txtProduct = (TextView) findViewById(R.id.product_label);
  
      Intent intent = getIntent();
      // getting attached intent data
      String product = getIntent().getStringExtra("product");
      int position=getIntent().getIntExtra("pos", 1);
      // displaying selected product name
      txtProduct.setText(" \n"+position+"  \n" +product);
      }
  </code></pre>