title: Android ListView- Error on setListAdapter & getListAdapter?
body: <p>i have the Following Code in MainAvtivity:</p>
  
  <pre><code>private DBOperations DataDBoperation;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          DataDBoperation = new DBOperations(this);
          DataDBoperation.open();
  
          List values = DataDBoperation.getAllUserSIMs();
  
          // Use the SimpleCursorAdapter to show the
          // elements in a ListView
          ArrayAdapter adapter = new ArrayAdapter(this,
                  android.R.layout.simple_list_item_1, values);
          setListAdapter(adapter);
  
  
  
      }
      public void addSim(View view) {
  
          ArrayAdapter adapter = (ArrayAdapter) getListAdapter();
  
          EditText text = (EditText) findViewById(R.id.editText1);
          SIMsClass stud = DataDBoperation.addSIMs(text.getText().toString());
  
          adapter.add(stud);
  
      }
  
      public void deleteSim(View view) {
  
          ArrayAdapter adapter = (ArrayAdapter) getListAdapter();
          SIMsClass sim = null;
  
          if (getListAdapter().getCount() &gt; 0) {
              sim = (SIMsClass) getListAdapter().getItem(0);
              DataDBoperation.deleteSIMs(sim);
              adapter.remove(sim);
          }
  
      }
  
      public void addPassword(View view) {
  
          ArrayAdapter adapter = (ArrayAdapter) getListAdapter();
  
          EditText text = (EditText) findViewById(R.id.editText2);
          PasswordClass stud = DataDBoperation.addPassword(text.getText().toString());
  
          adapter.add(stud);
  
      }
  </code></pre>
  
  <p>and here is the layoun XML file:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:paddingBottom="@dimen/activity_vertical_margin"
      android:paddingLeft="@dimen/activity_horizontal_margin"
      android:paddingRight="@dimen/activity_horizontal_margin"
      android:paddingTop="@dimen/activity_vertical_margin"
      tools:context=".MainActivity" &gt;
  
      &lt;TextView
          android:id="@+id/textView1"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_alignParentTop="true"
          android:layout_marginLeft="113dp"
          android:text="TextView" /&gt;
  
      &lt;EditText
      android:id="@+id/editText1"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_alignParentLeft="true"
      android:layout_alignParentTop="true"
      android:ems="10" &gt;
  
          &lt;requestFocus /&gt;
      &lt;/EditText&gt;
  
      &lt;Button
          android:id="@+id/addBtn"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/editText1"
          android:onClick="addSim"
          android:text="Add New" /&gt;
  
      &lt;Button
          android:id="@+id/deleteBtn"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_toRightOf="@+id/addBtn"
          android:layout_below="@+id/editText1"
          android:onClick="deleteSim"
          android:text="Delete First" /&gt;
  
      &lt;ListView
          android:id="@android:id/list"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_below="@+id/deleteBtn" &gt;
      &lt;/ListView&gt;
  
      &lt;EditText
          android:id="@+id/editText2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:layout_below="@+id/addBtn"
          android:ems="10" /&gt;
  
      &lt;Button
          android:id="@+id/passwordBtn"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_above="@android:id/list"
          android:layout_toRightOf="@+id/editText1"
          android:onClick="addPassword"
          android:text="@string/password" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p><em><strong>ERROR:</em><br>
  The method is setListAdapter(Adapter) undefined for the type MainActivity.<br>
  The method is getListAdapter(Adapter) undefined for the type MainActivity.</strong>  </p>