-1

我想知道为什么 java 类中的图像视图会出现错误,比如ImageView smtin; And there's error。它不承认它像类...

我的项目代码是:

    package com.klemenjezakon.koceSLO;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;

ImageView slika;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FULLSCREEN);

        Intent i = getIntent();
        koca podatki=(koca)i.getSerializableExtra("koca");


        setContentView(R.layout.koca);
    }

}
4

1 回答 1

0

你必须把你的班级。所以而不是:

ImageView slika;

public class MainActivity extends Activity {

它必须是:

public class MainActivity extends Activity {

    ImageView slika;
于 2013-01-20T10:56:43.237 回答