小编Ine*_*eza的帖子

如何使用Java类从资源mipmap获取图像

我在Android Studio中创建了一个Java类文件,但我不知道如何从mipmap获取图像.我试图添加上下文但它不起作用.

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Ineza on 18/11/2016.
 */

public class DerpData {
    private static final String[] titles = {
        "Nothingness cannot be  defined",
        "The softest thing cannot be snapped",
        "be like water, my friend."
    };
    private static final int[] icons = ;

    public static List<LisItem> getListData() {
        List<LisItem> data = new ArrayList<>();

        // Repeat process 4 times, so that we have enough data to demonstrate a scrollable
        // RecyclerView
        for (int x = 0; …
Run Code Online (Sandbox Code Playgroud)

java android load image android-resources

6
推荐指数
1
解决办法
2714
查看次数

标签 统计

android ×1

android-resources ×1

image ×1

java ×1

load ×1