小编Wac*_*oon的帖子

格式字符串XXX不是有效的格式字符串,因此不应将其传递给String.format

我有android应用程序和资源中的这个字符串:

<string name="create_group_select_people">Select up to %1$d people!</string>
Run Code Online (Sandbox Code Playgroud)

这是从片段调用的:

Integer countMax = 5; //also tried just "int" - nothing changed
getResources().getString(R.string.create_group_select_people, countMax);
Run Code Online (Sandbox Code Playgroud)

但是我得到了错误:

Format string 'create_group_select_people' is not a valid format string so it should not be passed to String.format
Run Code Online (Sandbox Code Playgroud)

我无法理解什么是错的?当我启动应用程序时 - 它按字面意思显示"选择最多%1美元的人!"

java string android android-resources

23
推荐指数
5
解决办法
1万
查看次数

如何通过用户ID搜索Fabric中的问题?

我在我的Android应用程序中使用Fabric/Crashlytics,我使用自定义日志记录连接问题并将用户ID附加到日志,但是如何搜索特定用户的日志?

对于用户ID附件,我使用Crashlytics.setUserIdentifier(getUserId());方法.对于我使用的密钥附件Crashlytics.setString("error_type", "ConnectionException500");

我可以在结构日志中使用此ID,我可以在搜索"连接"等自定义键中逐字搜索问题,它会将所有问题ConnectionException500作为自定义键返回,但我无法理解如何搜索特定用户?喜欢ID为2332的用户.

我试图寻找user:2332user=2332公正2332,但它说明不了什么,我知道那里是与特定用户的问题(我可以看到其中的一些)

logging android crashlytics google-fabric

6
推荐指数
0
解决办法
1055
查看次数