Android资源中的字典

编程入门 行业动态 更新时间:2024-10-24 14:17:45
本文介绍了Android资源中的字典的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有没有一种方法可以在Android资源中使用字典.我在String.xml文件中找不到有关字典的任何内容,而可搜索文件还有许多我不需要的其他字段.

Is there a way to use dictionary in android resources. I couldn't find anything in String.xml file about dictionary and searchable file has many other fields that I don't need.

在C#和Visual Studio中,我们可以将字典以及字符串或整数添加到资源中,但是,我找不到将字典添加到资源的任何选项,并且仅在字符串和字符串数组或整数上可用android资源.

Edited: in C# and visual studio we can add dictionary to the resources as well as string or int, however, I couldn't find any option for adding dictionary to the resources and only string and string array or integer are available on android resources.

推荐答案

没有这样的资源类型.您必须将任意文件放在res/raw/中,然后手动将其导入到HashMap中.

There is no such a resource type. You have to put an arbitrary file in res/raw/ and import it manually in a HashMap.

更多推荐

Android资源中的字典

本文发布于:2023-11-12 03:42:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580411.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字典   资源   Android

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!