我已经创建了一个ListView,可以显示项目和子项目列表,并遵循以下问题:android-listview-subitems。
然而,当我点击其中一行时,我收到错误:E / MessageQueue-JNI:java.lang.ClassCastException:android.widget.TwoLineListItem无法强制转换为android.widget.TextView
只有在我向ListView中的每个项目添加子项目后才会出现错误。
listView的侦听器中出现错误,如下面的代码所示:
//use Symfony\Component\Form\Extension\Core\Type\EmailType;
//use Symfony\Component\Form\Extension\Core\Type\TextType;
const textType = 'Symfony\Component\Form\Extension\Core\Type\TextType';
const emailType = 'Symfony\Component\Form\Extension\Core\Type\EmailType';
class ProfileType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('username', textType, array('label' => 'Username'))
->add('address1', textType, array('label' => 'Address1'))
->add('address2', textType, array('label' => 'Address2'))
->add('postcode', textType, array('label' => 'Postcode'))
;
}
有没有办法在ListView中拥有一组项目和子项目但是有意打开另一项活动工作?