title: Create ListView programmatically
body: <p>Hi I am new in Android. Could anyone tell me pls whats the wrong with the following code:</p>
  
  <pre><code>public class ListApp extends Activity {
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          TextView lText = new TextView(this);
          lText.setId(0);       
  
          ListView lView = new ListView(this);
          String[] lStr = new String[]{"AA","BB", "CC"};
          ArrayAdapter lAdap = new ArrayAdapter(this,lText.getId(),lStr);
          lView.setAdapter(lAdap);
          lView.setFocusableInTouchMode(true);        
  
          setContentView(lView);
      }
  }
  </code></pre>