title: My ListView wouldn't work. I'm missing out something here
body: <p>I casted this line: lv1.setOnItemClickListener((OnItemClickListener) this); because it creates a red squiggly line. 
  Am I using the onItemClick function properly?</p>
  
  <pre><code> public class MainActivity extends Activity {
  
  private ListView lv1;
  private String lv_arr[] = {
          "Android",
          "iPhone",
          "Blackberry",
          "AndroidPeople"
  };
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      lv1 = (ListView) findViewById(R.id.ListView01);
      lv1.setOnItemClickListener((OnItemClickListener) this);
      //by using setAdapter method in ListView, we can add string array in list
  
      lv1.setAdapter(new ArrayAdapter&lt;String&gt;(
              this, android.R.layout.simple_list_item_1, lv_arr));
  
  }
  
  public void onItemClick(AdapterView arg0, View v, int position, long arg3){
  
      Toast.makeText(this, "You clicked" + lv_arr[position],       Toast.LENGTH_LONG).show();
  
  }
  
  
  
   }
  </code></pre>