我已将线性层设置为可点击,并希望它像一个按钮一样开始一个新的活动。但是我得到了错误。这是 .xml 的一部分
<LinearLayout
android:id="@+id/llproduct1"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="vertical" android:clickable="true">
<ImageView .... />
<TextView .... />
</LinearLayout>
这是 .java 按钮 bProduct1 = (Button) findViewById(R.id.llproduct1); bProduct1.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
startActivity(new Intent("com.testing.PRODUCTDESCRIPTION"));
}
什么地方出了错?