当我在片段中使用Androidplot时,它无法读取line_point_formatter_with_labels.xml

时间:2017-11-03 19:51:38

标签: java android xml android-fragments androidplot

我正在尝试使用this link

中的示例

enter image description here

我对代码进行了小修改,我使用的是片段而不是示例代码中的活动。现在,我遇到了line_point_formatter_with_labels.xmlline_point_formatter_with_labels_2.xml配置文件的问题。示例代码无法从文件中读取值。它发生在以下行:

LineAndPointFormatter series1Format =
                    new LineAndPointFormatter(getActivity(), R.xml.line_point_formatter_with_labels);

我有这样的错误

  

java.lang.NumberFormatException:无效的int:“#00AA00”。

知道为什么会这样吗?

感谢。

1 个答案:

答案 0 :(得分:0)

有一个与此类似的问题似乎是对3.0.1中的Android Gradle插件造成某种未记录的更改。

如果你想检查这是否会影响你,那么短期修复就是恢复到2.3.3。该问题也将在Androidplot 1.5.2中得到解决。

顺便说一句,Androidplot已将它的主要回购从Bitbucket转移到Github。你可以使用任何一个,但Bitbucket repo偶尔会落后于发行版。