Java 在绑定自定义视图事件中,我可以对此执行什么操作?请告诉我

Java 在绑定自定义视图事件中,我可以对此执行什么操作?请告诉我,java,android,android-studio,Java,Android,Android Studio,我正在创建一个聊天应用程序。这是聊天活动,我有一个显示聊天的列表视图。但是在它的绑定自定义视图中,我遇到了以下错误。请告诉我如何解决这些错误。 所有使用的变量都是预定义的。在最后一次输入重复代码后,我出现了这些错误。请告诉我如何解决这些错误 为列表视图绑定自定义视图时出错 if (_data.get((int)_position).get("from").toString().equals(data.getString("mobile", "&q

我正在创建一个聊天应用程序。这是聊天活动,我有一个显示聊天的列表视图。但是在它的绑定自定义视图中,我遇到了以下错误。请告诉我如何解决这些错误。 所有使用的变量都是预定义的。在最后一次输入重复代码后,我出现了这些错误。请告诉我如何解决这些错误

为列表视图绑定自定义视图时出错

if (_data.get((int)_position).get("from").toString().equals(data.getString("mobile", "")) && _data.get((int)_position).get("to").toString().equals(getIntent().getStringExtra("mobile"))) {
    whole.setVisibility(View.VISIBLE);
    own_full.setVisibility(View.VISIBLE);
    other_full.setVisibility(View.GONE);
    _decryptString(_data.get((int)_position).get("mes").toString(), data.getString("mobile", ""));
    mes_own.setText(decrypted);
    time_own.setText(_data.get((int)_position).get("time").toString());
    if (_data.get((int)_position).get("image").toString().equals("")) {
        image_own.setVisibility(View.GONE);
    }
    else {
        image_own.setVisibility(View.VISIBLE);
        Glide.with(getApplicationContext()).load(Uri.parse(_data.get((int)_position).get("image").toString())).into(image_own);
        Glide.with(getApplicationContext()).load(Uri.parse(_data.get((int)_position).get("image").toString())).placeholder(R.drawable.ertyu).into(image_own);
        image_own.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View _view) {
                intt.setClass(getApplicationContext(), ViewimageActivity.class);
                intt.putExtra("url", _data.get((int)_position).get("image").toString());
                startActivity(intt);
            }
        });
        if (_data.get((int)_position).get("mes").toString().equals("")) {
            mes_own.setVisibility(View.GONE);
        }
    }
    if (_data.get((int)_position).get("video").toString().equals("")) {
        video_own.setVisibility(View.GONE);
    }
    else {
        video_own.setVisibility(View.VISIBLE);
        video_own.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View _view) {
                intt.setClass(getApplicationContext(), ViewvideoActivity.class);
                intt.putExtra("url", _data.get((int)_position).get("video").toString());
                startActivity(intt);
            }
        });
        mes_own.setVisibility(View.GONE);
    }
    _Round(18, 0, 18, 18, "#FFFFFF", linear5);
    if (_data.get((int)_position).get("file").toString().equals("")) {
        file_own.setVisibility(View.GONE);
    }
    else {
        mes_own.setVisibility(View.GONE);
        file_own.setVisibility(View.VISIBLE);
    }
}
else {
    if (_data.get((int)_position).get("to").toString().equals(data.getString("mobile", "")) && _data.get((int)_position).get("from").toString().equals(getIntent().getStringExtra("mobile"))) {
        _Round(0, 18, 18, 18, "#FFFFFF", linear6);
        whole.setVisibility(View.VISIBLE);
        own_full.setVisibility(View.GONE);
        other_full.setVisibility(View.VISIBLE);
        _decryptString(_data.get((int)_position).get("mes").toString(), _data.get((int)_position).get("from").toString());
        mes_other.setText(decrypted);
        textview4.setText(_data.get((int)_position).get("time").toString());
        if (_data.get((int)_position).get("image").toString().equals("")) {
            image_other.setVisibility(View.GONE);
        }
        else {
            image_other.setVisibility(View.VISIBLE);
            Glide.with(getApplicationContext()).load(Uri.parse(_data.get((int)_position).get("image").toString())).into(image_other);
            Glide.with(getApplicationContext()).load(Uri.parse(_data.get((int)_position).get("image").toString())).placeholder(R.drawable.ertyu).into(image_other);
            image_other.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View _view) {
                    intt.setClass(getApplicationContext(), ViewimageActivity.class);
                    intt.putExtra("url", _data.get((int)_position).get("image").toString());
                    startActivity(intt);
                }
            });
            if (_data.get((int)_position).get("mes").toString().equals("")) {
                mes_other.setVisibility(View.GONE);
            }
        }
        if (_data.get((int)_position).get("video").toString().equals("")) {
            video_other.setVisibility(View.GONE);
        }
        else {
            mes_other.setVisibility(View.GONE);
            video_other.setVisibility(View.VISIBLE);
            video_other.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View _view) {
                    intt.setClass(getApplicationContext(), ViewvideoActivity.class);
                    intt.putExtra("url", _data.get((int)_position).get("video").toString());
                    startActivity(intt);
                }
            });
        }
        if (_data.get((int)_position).get("file").toString().equals("")) {
            file_other.setVisibility(View.GONE);
        }
        else {
            mes_other.setVisibility(View.GONE);
            file_other.setVisibility(View.VISIBLE);
        }
    }
    else {
        whole.setVisibility(View.GONE);
    }
    _detectLinks(mes_own);
    _detectLinks(mes_other);
}
whole.setOnLongClickListener(new View.OnLongClickListener() {
    @Override
    public boolean onLongClick(View _view) {
        fokat = 0;
        for(int _repeat199 = 0; _repeat199 < (int)(delete.size()); _repeat199++) {
            if (delete.get((int)(fokat)).doubleValue() == _position) {
                whole.setBackgroundColor(Color.TRANSPARENT);
                delete.remove((int)(fokat));
                if (delete.size() == 0) {
                    _name();
                }
            }
            else {
                whole.setBackgroundColor(0xFFFCE4EC);
                delete.add(Double.valueOf(_position));
                _delete_tray_visible();
            }
            fokat++;
        }
        return true;
    }
});
if(_data.get((int)_position.get(“from”).toString().equals(data.getString(“mobile”)和&(u data.get((int)_position.get(“to”).toString().equals(getIntent().getStringExtra(“mobile”)){
整体.setVisibility(View.VISIBLE);
own_full.setVisibility(视图可见);
其他_full.setVisibility(视图已消失);
_decryptString(_data.get((int)_position).get(“mes”).toString(),data.getString(“mobile”);
mes_own.setText(已解密);
time_own.setText(_data.get((int)_position.get(“time”).toString());
if(_data.get((int)_position).get(“image”).toString().equals(“”){
图像自身设置可见性(View.GONE);
}
否则{
图像自身设置可见性(视图可见);
Glide.with(getApplicationContext()).load(Uri.parse(_data.get((int)_position.get(“image”).toString())加载到(image_-own)中;
Glide.with(getApplicationContext()).load(Uri.parse(_data.get((int)_position).get(“image”).toString()).placeholder(R.drawable.ertyu).into(image\u own);
image\u own.setOnClickListener(新视图.OnClickListener(){
@凌驾
公共void onClick(视图_视图){
setClass(getApplicationContext(),ViewimageActivity.class);
intt.putExtra(“url”),_data.get((int)_position.get(“image”).toString();
起始触觉(intt);
}
});
if(_data.get((int)_position).get(“mes”).toString().equals(“”){
mes_own.setVisibility(视图已消失);
}
}
if(_data.get((int)_position).get(“视频”).toString().equals(“”){
视频自身设置可见性(视图已消失);
}
否则{
视频自身设置可见性(View.VISIBLE);
video_own.setOnClickListener(新视图.OnClickListener(){
@凌驾
公共void onClick(视图_视图){
setClass(getApplicationContext(),ViewvideoActivity.class);
intt.putExtra(“url”),_data.get((int)_position.get(“video”).toString();
起始触觉(intt);
}
});
mes_own.setVisibility(视图已消失);
}
_圆形(18,0,18,18,“#FFFFFF”,直线5);
if(_data.get((int)_position).get(“文件”).toString().equals(“”){
文件_own.setVisibility(View.GONE);
}
否则{
mes_own.setVisibility(视图已消失);
文件_own.setVisibility(View.VISIBLE);
}
}
否则{
如果(_data.get((int)_position).get(“to”).toString().equals(data.getString(“mobile”)和(_data.get((int)_position).get(“from”).toString().equals(getIntent().getStringExtra(“mobile”)){
_圆形(0,18,18,18,“#FFFFFF”,线性6);
整体.setVisibility(View.VISIBLE);
own_full.setVisibility(视图已消失);
其他_full.setVisibility(视图可见);
_解密字符串(_data.get((int)_position).get(“mes”).toString(),_data.get((int)_position).get(“from”).toString();
mes_other.setText(已解密);
textview4.setText(_data.get((int)_position.get(“time”).toString());
if(_data.get((int)_position).get(“image”).toString().equals(“”){
image_other.setVisibility(View.GONE);
}
否则{
图像_other.setVisibility(视图可见);
Glide.with(getApplicationContext()).load(Uri.parse(_data.get((int)_position.get(“image”).toString())加载到(image_other)中;
Glide.with(getApplicationContext()).load(Uri.parse(_data.get((int)_position).get(“image”).toString()).placeholder(R.drawable.ertyu).into(image\u other);
image\u other.setOnClickListener(新视图.OnClickListener(){
@凌驾
公共void onClick(视图_视图){
setClass(getApplicationContext(),ViewimageActivity.class);
intt.putExtra(“url”),_data.get((int)_position.get(“image”).toString();
起始触觉(intt);
}
});
if(_data.get((int)_position).get(“mes”).toString().equals(“”){
mes_other.setVisibility(View.GONE);
}
}
if(_data.get((int)_position).get(“视频”).toString().equals(“”){
video_other.setVisibility(View.GONE);
}
否则{
mes_other.setVisibility(View.GONE);
视频_other.setVisibility(View.VISIBLE);
video\u other.setOnClickListener(新视图.OnClickListener(){
@凌驾
公共void onClick(视图_视图){
setClass(getApplicationContext(),ViewvideoActivity.class);
intt.putExtra(“url”),_data.get((int)_position.get(“video”).toString();
起始触觉(intt);
}
});
}
if(_data.get((int)_position).get(“文件”).toString().equals(“”){
文件_other.setVisibility(View.GONE);
}
否则{
mes_other.setVisibility(View.GONE);
文件_other.setVisibility(View.VISIBLE);
}
}
否则{
整体.setVisibility(View.GONE);
}
_检测链路(自己的);
_检测链路(mes_其他);
}
整台.setOnLongClickListener(新视图.OnLongClickListener(){
@凌驾
公共布尔onLongClick(视图_视图){
fokat=0;
对于(int _repeat199=0;_repeat199<(int)(delete.size());_repeat199++){
if(delete.get((int)(fokat)).doubleValue()=\u位置){
整体.背景色(颜色.透明);
删除.删除((int)(fokat));
如果(delete.size()==0){