title: Unable to display item from listView on another activity
body: <p>I want the clicked item to be displayed in another activity.The second activity appears but the string doesn't. I tried other methods as well but the second activity just remains blank.
  Here is the Main Activity</p>
  
  <pre><code>EditText TxtOne;
  Button btOne;
  ListView lisOne;
  ArrayList aL;
  ArrayAdapter&lt;String&gt; adapt;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      TxtOne = (EditText) findViewById(R.id.TxtOne);
      btOne = (Button) findViewById(R.id.btOne);
      lisOne = (ListView) findViewById(R.id.lisOne);
  
      aL = new ArrayList&lt;String&gt;();
      adapt = new ArrayAdapter&lt;String&gt;(MainActivity.this,android.R.layout.simple_list_item_1,aL);
      lisOne.setAdapter(adapt);
      onBClick();
      lisOne.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; adapter, View view, int position, long id) {
              Intent itemInfo = new Intent(MainActivity.this, secondActivity.class);
              itemInfo.putExtra("Itemis",position);
              startActivity(itemInfo);
  
          }
      });
  }
  
  public void onBClick(){
      btOne.setOnClickListener(new View.OnClickListener(){
          @Override
          public void onClick(View v) {
              String InpItem = TxtOne.getText().toString();
              aL.add(InpItem);
              adapt.notifyDataSetChanged();
          }
  
      });
  }
  </code></pre>
  
  <p>The following is the second Activity</p>
  
  <pre><code>public class secondActivity extends AppCompatActivity {
      TextView txt2;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_second);
  
          Bundle passedData = getIntent().getExtras();
          txt2 = (TextView)findViewById(R.id.txt2);
          txt2.setText(passedData.getString("Itemis"));
      }
  }
  </code></pre>
  
  <p>I have read other similar posts but none of them work.
  Some talk about the textView not being in the active layout because of which the result is NULL. The textView is in the active layout but still it doesn't display the item.
  Solution anyone??</p>