android-无法从广播接收器获取资源

android-无法从广播接收器获取资源,第1张

概述由于某些原因,我无法获取strings.xml内的字符串.这是我的代码:publicclassSDK_ReferrerextendsBroadcastReceiver{@OverridepublicvoidonReceive(Contextcontext,Intentintent){Stringsrt=context.getResources().getString(R.string.master);它无法识别“

由于某些原因,我无法获取strings.xml内的字符串.
这是我的代码:

public class SDK_Referrer extends broadcastReceiver {@OverrIDepublic voID onReceive(Context context, Intent intent) {  String srt = context.getResources().getString(R.string.master);

它无法识别“主”字符串.
当我检查我在R.string中获得什么选项时…我得到了R.string.copy或R.string.cancel或R.string.ok …之类的东西,而不是我在xml文件.
这是为什么?

解决方法:

您可能正在从自己的应用程序中导入androID.R;

总结

以上是内存溢出为你收集整理的android-无法从广播接收器获取资源全部内容,希望文章能够帮你解决android-无法从广播接收器获取资源所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1085311.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-27
下一篇 2022-05-27

发表评论

登录后才能评论

评论列表(0条)

保存