title: Sending Intent from Listview onItemClickListener error
body: <p>Just a quick question, I'm guessing I've missed something really easy and obvious. The following code is called when a listview item is accessed, and it passes the id to the next activity. I'm getting a runtime error, log cat is showing me this </p>
  
  <pre><code>error:java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tim.apps.list/com.tim.apps.list.Challengeview}: java.lang.NumberFormatException: Invalid int: "null" 
  </code></pre>
  
  <p>Heres the code for my first activity:</p>
  
  <pre><code>ListView lv = getListView();
     lv.setOnItemClickListener(new OnItemClickListener()
     {
        @Override
        public void onItemClick(AdapterView&lt;?&gt; adapter, View v, int position,
              long arg3) 
        {
              String index = (String)adapter.getItemAtPosition(position); 
              //Intent myIntent = new Intent(ChallengesList.this, Challengeview.class);
              //ChallengesList.this.startActivity(myIntent);
              Intent i = new Intent(getApplicationContext(), Challengeview.class);
              i.putExtra(index, position);
              startActivity(i);
        }
     });
  </code></pre>
  
  <p>And in my second activity..</p>
  
  <pre><code>Bundle extras = getIntent().getExtras();
  String value = extras.getString("index");
  
  //Convert the passed id to a integer
  int intvalue = Integer.parseInt(value);
  </code></pre>
  
  <p>Thanks heaps for any help you guys can give!</p>