java在显示DialogFragment活动时出错
通过以下代码,我得到了这个错误:
error:';' expected dialogFragment.show((Activity) _context).getSupportFragmentManager(), "Dialog"));
@Override
public View getChildView(int groupPosition, final int childPosition,
boolean isLastChild, View convertView, ViewGroup parent) {
final String childText = (String) getChild(groupPosition, childPosition);
if (convertView == null) {
LayoutInflater infalInflater = (LayoutInflater) this._context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = infalInflater.inflate(R.layout.list_item, null);
}
TextView txtListChild = (TextView) convertView.findViewById(R.id.lblListItem);
Button btnListChild = (Button) convertView.findViewById(R.id.btn);
btnListChild.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
CustomDialogClass dialogFragment = new CustomDialogClass();
dialogFragment.show((Activity) _context).getSupportFragmentManager(), "Dialog"));
}
});
txtListChild.setText(childText);
return convertView;
}
# 1 楼答案
改变对话片段。显示((活动)_上下文)。getSupportFragmentManager(),“对话框”); 使分裂。显示((活动)_上下文。getSupportFragmentManager(),“对话框”)