【问题标题】:Getting what is in a view on ContextMenuListener [duplicate]获取 ContextMenuListener 视图中的内容 [重复]
【发布时间】:2013-02-25 07:36:06
【问题描述】:

我怎样才能获得,我长时间单击的 ContextMenu 的列表项中有什么?我尝试使用v.getTag(),但总是返回null

@Override
    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
        clsStTwoLineAdapter.ViewHolder holder = (clsStTwoLineAdapter.ViewHolder)v.getTag();
                 .
                 .
                 .
                 .
}

这是我的 ViewHolder

public class ViewHolder {
        TextView text;
        TextView text2;
        TextView text3;
        ImageView imgLineItem;
        int MessageID;
    }

就像我说的holder 始终是null,那么我还能如何获得其中的内容?

【问题讨论】:

    标签: android android-view


    【解决方案1】:

    看到这个post

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-06-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-06-25
    • 2021-03-30
    • 2012-02-23
    • 1970-01-01
    相关资源
    最近更新 更多