Google Play服务Admob迁移 - InjectView.value必须是常量

时间:2014-10-09 19:05:21

标签: android eclipse admob google-play-services

我正在进行Google Play服务迁移以获取内容,不幸的是,在我的项目中实施Google Play服务库时,我似乎遇到了障碍。

我的现有代码运行正常,但是它似乎不喜欢Google Play服务库。

错误 - ''注释属性InjectView.value的值必须是常量表达式'' -

@注入 private DataSource mDataSource;

@InjectView(R.id.progress) 私有TextView mProgressTextView;

@InjectView(R.id.fragmentContainer) private ViewGroup mFragmentContainer;

@InjectView(R.id.messages) 私人查看mSoundWarning;

@InjectView(R.id.score) 私有TextView mScoreTextView;

谢谢,希望你能帮忙

1 个答案:

答案 0 :(得分:0)

库项目不在其R文件中使用常量标识符。这使得在@InjectView注释中无法使用库项目ID,因为注释需要常量值。

相反,请使用视图标记来标识您的观看次数。

@InjectView(tag =“foobar”)TextView foobarView; 在你的布局中: