private int pos = position;
@Override
public void onClick(View v) {
Toast.makeText(context, "Click-" + String.valueOf(pos), Toast.LENGTH_SHORT).show();
iBean = (InboxBean)result.get(position);
ConstantData.inbox_subject = iBean.subject;
ConstantData.inbox_body = iBean.body;
ConstantData.inbox_postDate = iBean.postdate;
startActivity(new Intent(InboxActivity.this,InboxDetailActivity.class));//getting error at startActivity
}
});
我在星体活动线得到以下错误:
"Cannot make a static reference to the non-static method startActivity(Intent) from the type Activity"
请帮忙。
最佳答案
我假设你在你活动的内部静态类中有这个。别那么做。onclicklisteners应该存在于活动的特定实例的上下文中。