单击列表视图后,我无法创建意图。完成后提示错误
应用程序意外停止,请重试
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Intent IntentDiscution = new Intent(view.getContext(), lstchoi.class);
IntentDiscution.setClass(InterfaceAcceuil.this, lstchoi.class);
startActivityForResult(IntentDiscution, 0);
}
确保您已声明lstchoi
在你的manifest.xml中。假设它是一个 Activity,您会执行以下操作:
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".lstchoi"/>
您还可以删除此行:
IntentDiscution.setClass(InterfaceAcceuil.this, lstchoi.class);
这是多余的,因为您使用构造函数来指示相同的信息。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)