Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/391.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/179.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 我无法从res/raw加载某些平台中的图像和文本_Java_Android_Getresource - Fatal编程技术网

Java 我无法从res/raw加载某些平台中的图像和文本

Java 我无法从res/raw加载某些平台中的图像和文本,java,android,getresource,Java,Android,Getresource,我有一个布局,我的图片和文本文件在res/raw文件夹是由用户搜索加载。 图像名称以p+月+日开头,文本文件以t开头。 用户搜索日期时,java按月份和日期创建文件名。 但这并不是在平板电脑10和索尼xperia T等平台上显示图像和文本 形象 正文 日志: D/dalvikvm﹕ Not late-enabling CheckJNI (already on) E/Trace﹕ error opening trace file: No such file or directory (2) D/d

我有一个布局,我的图片和文本文件在res/raw文件夹是由用户搜索加载。 图像名称以p+月+日开头,文本文件以t开头。 用户搜索日期时,java按月份和日期创建文件名。 但这并不是在平板电脑10和索尼xperia T等平台上显示图像和文本

形象

正文

日志:

D/dalvikvm﹕ Not late-enabling CheckJNI (already on)
E/Trace﹕ error opening trace file: No such file or directory (2)
D/dalvikvm﹕ GC_FOR_ALLOC freed 39K, 7% free 2430K/2592K, paused 72ms, total 77ms
I/dalvikvm-heap﹕ Grow heap (frag case) to 3.075MB for 614416-byte allocation
D/dalvikvm﹕ GC_FOR_ALLOC freed 1K, 6% free 3029K/3196K, paused 66ms, total 66ms
D/dalvikvm﹕ GC_CONCURRENT freed <1K, 6% free 3029K/3196K, paused 8ms+5ms, total 90ms
D/gralloc_goldfish﹕ Emulator without GPU emulation detected.
I/Choreographer﹕ Skipped 32 frames!  The application may be doing too much work on its main thread.
I/Choreographer﹕ Skipped 68 frames!  The application may be doing too much work on its main thread.
D/dalvikvm﹕ GC_FOR_ALLOC freed 21K, 5% free 3184K/3328K, paused 253ms, total 273ms
I/dalvikvm-heap﹕ Grow heap (frag case) to 3.810MB for 614416-byte allocation
D/dalvikvm﹕ GC_CONCURRENT freed 4K, 4% free 3779K/3932K, paused 12ms+69ms, total 253ms
I/Choreographer﹕ Skipped 42 frames!  The application may be doing too much work on its main thread.

无法理解您的问题,因为您拒绝使用标点符号。@jb15613抱歉,我已修复它。您可以发布日志或控制台输出吗?没有人可以帮助我???
    TextView txtContent = (TextView) findViewById(R.id.date);
    String mAssetsName = ("raw/t"+Split_MD[0]+"_"+Split_MD[1]);
    txtContent.setTypeface(face);

    try {
        Resources res1 = getResources();
        InputStream in_s = res1.openRawResource(getResources().getIdentifier(mAssetsName,"raw", getPackageName()));

        byte[] b = new byte[in_s.available()];
        in_s.read(b);
        txtContent.setText(new String(b));
    } catch (Exception e) {
        // e.printStackTrace();
        txtContent.setText("Error: can't show help.");
    }
D/dalvikvm﹕ Not late-enabling CheckJNI (already on)
E/Trace﹕ error opening trace file: No such file or directory (2)
D/dalvikvm﹕ GC_FOR_ALLOC freed 39K, 7% free 2430K/2592K, paused 72ms, total 77ms
I/dalvikvm-heap﹕ Grow heap (frag case) to 3.075MB for 614416-byte allocation
D/dalvikvm﹕ GC_FOR_ALLOC freed 1K, 6% free 3029K/3196K, paused 66ms, total 66ms
D/dalvikvm﹕ GC_CONCURRENT freed <1K, 6% free 3029K/3196K, paused 8ms+5ms, total 90ms
D/gralloc_goldfish﹕ Emulator without GPU emulation detected.
I/Choreographer﹕ Skipped 32 frames!  The application may be doing too much work on its main thread.
I/Choreographer﹕ Skipped 68 frames!  The application may be doing too much work on its main thread.
D/dalvikvm﹕ GC_FOR_ALLOC freed 21K, 5% free 3184K/3328K, paused 253ms, total 273ms
I/dalvikvm-heap﹕ Grow heap (frag case) to 3.810MB for 614416-byte allocation
D/dalvikvm﹕ GC_CONCURRENT freed 4K, 4% free 3779K/3932K, paused 12ms+69ms, total 253ms
I/Choreographer﹕ Skipped 42 frames!  The application may be doing too much work on its main thread.