小编Mis*_*die的帖子

为什么我在Android Studio中收到此错误"原始类型的预期资源"?

我试图通过使用按钮设置默认壁纸,但出于某种原因,当我在OnCreate方法中设置InputStream时,我得到此错误"raw type of raw".我正在引用drawable文件夹并使用drawable文件夹中的icon.png图像.我正在按照NewBoston系列中的教程进行操作,它似乎对Travis工作正常,但由于某种原因,我在Android Studio中无法工作.可能是什么错误?谢谢

Camera.java:

package com.example.user.cameraapplication;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.provider.MediaStore;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.Switch;

import java.io.IOException;
import java.io.InputStream;

/**
 * Created by user on 16-08-2015.
 */
public class Camera extends Activity implements View.OnClickListener{

    ImageView iv;
    Button b1,b2;
    ImageButton img;
    Intent i;
    final static  int cameractivity = 0;
    Bitmap b;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.photo);
        inititalize();
        InputStream is = getResources().openRawResource(R.drawable.icon);
        b = …
Run Code Online (Sandbox Code Playgroud)

java eclipse android inputstream android-studio

9
推荐指数
2
解决办法
1万
查看次数

为什么movsw指令将si和di寄存器增加2,而movsb指令将si和di寄存器增加1?

我正在使用平面汇编器以汇编语言处理 movsb 和 movsw 指令。现在,我注意到当执行 movsb 指令时,SI 和 DI 寄存器递增 1,而 movsw 指令则使 SI 和 DI 寄存器递增 2。我有点困惑为什么?谁能给我解释一下原因。我在下面添加了我的代码以用于带有注释的说明。请帮帮我。谢谢!

使用movsb指令(平面汇编器)

cld ;clear direction flag

lea si,[val]  ;the memory address of source is loaded in the source register

lea di,[v];the memory address of the destination is loaded in the destination register

mov cx,5 ; the counter basically executes for the number of characters in the array

rep movsb ; repeats the instruction for 5 times

val:
     db 'A' 
     db 'B'
     db 'C' …
Run Code Online (Sandbox Code Playgroud)

assembly fasm

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

标签 统计

android ×1

android-studio ×1

assembly ×1

eclipse ×1

fasm ×1

inputstream ×1

java ×1