简体   繁体   English

api和isEmpty方法之间的关系是什么

[英]what is the relation between the api and isEmpty method

I want to check if the String "registerationId" isImpty : 我想检查字符串“ registerationId”是否为isImpty:

String registrationId = prefs.getString(PROPERTY_REG_ID, "");
        if (registrationId.isEmpty()) {
            Toast.makeText(this, "registerationid not found in the prefrences",
                    Toast.LENGTH_LONG).show();
            return "";

        }

but the eclipse give me this error call require API level 9 (Current 8). 但是日食给我这个错误调用需要API级别9(当前为8)。 I don't understand what the relation between the API and a String method ? 我不明白API和String方法之间的关系是什么? and How suprresLint(New API) effect my project ? 以及suprresLint(New API)如何影响我的项目? thank you very much 非常感谢你

Some features require a minimum API level (because that means that basically they were introduced in that API), which must match the one specified in your AndroidManifest.xml file. 某些功能需要最低API级别(因为这意味着它们基本上是在 API中引入的),它必须与您的AndroidManifest.xml文件中指定的功能相匹配。 If you simply ignore it, you risk that when an user with a lower API than the needed installs your app, they'll get unexpected and undesirable effects, like errors, NullPointerException s, etc. 如果您只是忽略它,则可能会冒风险,当具有比所需API更低的API的用户安装您的应用时,他们会得到意想不到的不良影响,例如错误, NullPointerException等等。

It's always recommended to not ignore these alerts and make your minimal API according to the functions/methods/functionalities that you use. 始终建议不要忽略这些警报,并根据您使用的功能/方法/功能来制作最小的API

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM