The application assumes localization, so I want to litter a smaller project using the built-in Android resources. I'm trying to use a string in the application, which is stored in android.R.string.noApplications, but the studio writes "cannot resolve symbol noApplications" and the application is not going to. Why is that? After all, I can use other lines from this file, and there is no access specifier for this one. Is it possible and where to get system strings with localization?
1 answer
The range of available system string resources is very limited.
I'm not quite sure, but apparently this is due to the fact that the class R of system resources is not auto-generated, but created by static and the string section contains the following public keys:
public static final class string { public static final int VideoView_error_button = 17039376; public static final int VideoView_error_text_invalid_progressive_playback = 17039381; public static final int VideoView_error_text_unknown = 17039377; public static final int VideoView_error_title = 17039378; public static final int cancel = 17039360; public static final int copy = 17039361; public static final int copyUrl = 17039362; public static final int cut = 17039363; public static final int defaultMsisdnAlphaTag = 17039365; public static final int defaultVoiceMailAlphaTag = 17039364; public static final int dialog_alert_title = 17039380; public static final int emptyPhoneNumber = 17039366; public static final int fingerprint_icon_content_description = 17039384; public static final int httpErrorBadUrl = 17039367; public static final int httpErrorUnsupportedScheme = 17039368; public static final int no = 17039369; public static final int ok = 17039370; public static final int paste = 17039371; public static final int search_go = 17039372; public static final int selectAll = 17039373; public static final int selectTextMode = 17039382; public static final int status_bar_notification_info_overflow = 17039383; public static final int unknownName = 17039374; public static final int untitled = 17039375; public static final int yes = 17039379; public string() { throw new RuntimeException("Stub!"); } } accordingly, access to other keys "from the outside" is not possible.
In particular, the screenshot of decompilation android.jar and R.class in it:
|
