title: Android: how to populate two different listviews with database?
body: <p>I have an activity that stores assignments with their timestamp in ms. I then want an activity that lists all the timestamps and names of the activity if that activity is actually today or tomorrow. I started by just trying to show the timestamps for all of the activities that are today in one listview. This gives me and error saying that "_id" is does not exist as a column. Here's my code:</p>
  
  <pre><code>public class UpcomingActivity extends Activity implements LoaderManager.LoaderCallbacks&lt;Cursor&gt;{
  
  @SuppressLint("NewApi")
  private DatabaseHelper databaseHelper;
  private SimpleCursorAdapter mAdapter;
  private ListView listView;
  private String[] today= new String[5]; //max 5 values
  private String[] tom= new String[5]; //max 5 values
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_upcoming);
  
      databaseHelper = new DatabaseHelper(getApplicationContext());
  
      SQLiteCursorLoaderActivities cLoader = new SQLiteCursorLoaderActivities(getApplicationContext(),
                                                                                  databaseHelper,
                                                                                  null,
                                                                                  null);
  
      Cursor c = cLoader.buildCursor();
  
      c.moveToFirst();
      int todayTracker = 0; 
      int tomTracker = 0; 
      int alltimes = 1;
      long day = 86400000; // length of a day in ms
      String newText;
      TextView testField = (TextView)findViewById(R.id.test);
  
      listView = (ListView) findViewById(android.R.id.list);
      listView.setEmptyView(findViewById(android.R.id.empty));
  
      //loop through all records and check if the date is today!
    for(int i=0; i&lt;alltimes;i++){
      long time = c.getInt(i);
      if(DateUtils.isToday(time)){
  
      newText = String.valueOf(time);
  
      today[todayTracker] = newText; 
      todayTracker++;
      }
      else{
          time = time + day; //maybe it is tomorrow?
         if(DateUtils.isToday(time)){
  
              newText = String.valueOf(time);
  
              tom[tomTracker] = newText; 
              tomTracker++;
              }
      }
  
    }
  
      int[] toViews = {android.R.id.text2};
  
      mAdapter = new SimpleCursorAdapter( getApplicationContext(), 
               R.layout.my_list_element, 
               c, 
               today, 
               toViews, 
               0);
  
      listView.setAdapter(mAdapter);
  
  
      getLoaderManager().initLoader(0, null, this);
  
  }
  </code></pre>
  
  <p>Here is my log cat:</p>
  
  <pre><code>05-06 09:16:43.243: E/AndroidRuntime(2025): Caused by: java.lang.IllegalArgumentException: column '_id' does not exist
  </code></pre>
  
  <p>Why is there an error, and for the future how could I populate two different listviews? 
  Thanks!</p>