title: Android ListView with subitem causes TwoLineListItem cannot be cast to android.widget.TextView
body: <p>I've created a ListView that can display a list of items and subitems, following this question: <a href="https://stackoverflow.com/questions/23532652/android-listview-subitems">android-listview-subitems</a>.</p>
  
  <p>However, when I click on one of the rows, I get the error: E/MessageQueue-JNI: java.lang.ClassCastException: android.widget.TwoLineListItem cannot be cast to android.widget.TextView</p>
  
  <p>The error only started occurring once I added a subitem to each item in the ListView.</p>
  
  <p>The error occurs in the listener for the listView which is this code below:</p>
  
  <pre><code>   //listview listener
  lvAppFeatures.setOnItemClickListener(new AdapterView.OnItemClickListener() {
      @Override
      public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
  
          //find the selected item and store the value to send to next screen
          strSelectedFeature = ((TextView) view).getText().toString();
  
          //move to display screen
          Intent switchActivity = new Intent(MainActivity.this,
                  NextActivity.class);
  
          startActivity(switchActivity);
      }
  });
  </code></pre>
  
  <p>Is there a way to have a set of items and a subitems in a ListView but have intent to open another activity work?</p>