如何解决华为动态标签管理器,点击事件不响应
我在项目中实施了华为DTM,
具有依赖项:
implementation 'com.huawei.hms:dtm-api:5.0.0.301'
我将事件添加到如下所示的布局中,但是当我单击该项目时,没有响应。
布局代码:
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="onReport"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:contentDescription="@null"
android:src="@mipmap/ic_launcher" />
</androidx.appcompat.widget.LinearLayoutCompat>
和我的onReport函数:
public void onReport(View view) {
Bundle bundle = new Bundle();
bundle.putDouble("Price",9.99);
bundle.putDouble("Money",9.99);
if (instance != null) {
instance.onEvent("Purchase",bundle);
}
}
知道我做错了哪一部分吗?
解决方法
您需要在子布局上添加事件报告,但不适用于主布局。
在DTM的下一发行版中,将解决此问题。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。