提问人:Sneha Patel 提问时间:11/16/2023 最后编辑:David WasserSneha Patel 更新时间:11/17/2023 访问量:25
Android 资源链接问题
Android Resource linking issues
问:
Intent fromAct = getIntent();
String diylearn = fromAct.getStringExtra("diylearn");
String j = DisExpanded.dict1(diylearn);
public static String dict1(String a) {
HashMap<String, String> learn1 = new HashMap<String, String>();
learn1.put("","Not found");
learn1.put("Totebag","Description");
String data = learn1.get(a);
if (data != null) {
Log.d("DisExpanded", "Description for " + a + ": " + data);
} else {
Log.d("DisExpanded", "Description not found for " + a);
}
return data != null ? data : "Not found";
}
上面的代码 j 存储 null 值,但我已经在 HashMap 中列出了数据。
答: 暂无答案
评论
diylearn
diylearn