Skip to content

点击事件无法监听 #4

@caption-dylan

Description

@caption-dylan

StatusProvider

if(p instanceof FrameLayout){
    this.container = (FrameLayout) p;
    this.callback.onCreate(0, getStatusView());
 }else{
    throw new RuntimeException(contentView.getClass().getName() + "必须作为FrameLayout的子元素");
 }

在 StatusProvider类的构造方法中添加了
this.callback.onCreate(0, getStatusView());

设置点击事件,无响应

public void onCreate(int status, View statusView) {
    TextView tv = (TextView) statusView.findViewById(R.id.btn_retry);
    tv.setOnClickListener(new View.OnClickListener() {
    @Override
     public void onClick(View v) {
         Toast.makeText(MainActivity.this, "1231231321", Toast.LENGTH_LONG).show();
     }
});

这里的点击事件无法监听。

不知道是怎么回事呢?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions