我想在这里是当我点击标题列表视图时,内容将显示在对话框中。
答案 0 :(得分:0)
try this, hope this will help you.
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
View view = convertView;
if (view == null) {
LayoutInflater inflater = context.getLayoutInflater();
view = inflater.inflate(R.layout.row, null, true);
holder = new ViewHolder();
holder.title = (TextView) view.findViewById(R.id.title);
view.setTag(holder);
} else {
holder = (ViewHolder) view.getTag();
}
holder.title.setText("your title");
holder.title.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Toast.makeText(YourActivity.this,
"TextView clicked",Toast.LENGTH_SHORT).show();
//show dialog, pass information to dialog respective
//item click
}
});
return view;
}