Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/219.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何从Apportable中的桥接java类通过id访问某些视图?_Java_Android_Apportable - Fatal编程技术网

如何从Apportable中的桥接java类通过id访问某些视图?

如何从Apportable中的桥接java类通过id访问某些视图?,java,android,apportable,Java,Android,Apportable,这是关于合适的桥接。 我在main.xml中定义了一些特定的布局: <com.amazon.device.ads.AdLayout android:id="@+id/ad_view" android:layout_width="match_parent" android:layout_height="wrap_content"/> 当我试图通过standard访问它时 (AdLayout)activity.findViewBy

这是关于
合适的
桥接。

我在
main.xml
中定义了一些特定的
布局:

<com.amazon.device.ads.AdLayout
        android:id="@+id/ad_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>


当我试图通过standard访问它时

(AdLayout)activity.findViewById(R.id.ad\u视图)

我得到一个错误:

错误:找不到符号 adView=(AdLayout)activity.findViewById(R.id.ad_视图); ^符号:变量id位置:R类


所以问题是:如何从桥接Java类访问此视图?

请检查以下位置:

1. You created this main.xml and this one is included in one of the following value in configuration.json:
  • “额外舱单”:“
  • “活动清单”附加条款“
  • “应用程序清单”附加条款“
xml代码段必须包含在AndroidManifest.xml中,然后才能工作

2. If you have made the change in the configuration.json, the next step you may check is the target AndroidManifest.xml, make sure that the main.xml is included in the correct place. If the snippet is not included, you may clean the Build directory of Apportable SDK and redo a load.
希望这些信息能对你有所帮助


谢谢

您是否尝试过从
project->clean
中清除项目?因为在日志中,
^
用于视图id,而视图id无效@ρ∑ρѕρєK首先,我使用
Intellij IDEA
来编码
java
。实际上,java项目本身构建得很好,没有任何错误,包括上面提到的代码。用合适的工具编译项目时出现错误。哦,我可能会出错。在这种情况下,您可能希望将该xml包含到资源中。在本例中,您可以将xml目录的名称放入configuration.json中的“java_res_dirs”中。