Android无法解析为类型

标签 android

我的代码中出现“无法解析为类型”。我正在寻找解决方案,但所有解决方案均无效。

import android.app.Activity;
import android.os.Bundle;
import android.view.View;

public class Vortex extends Activity {

    private static final String LOG_TAG = Vortex.class.getSimpleName();
    private VortexView _vortexView; //there is the problem

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        _vortexView = new VortexView(this);
        setContentView(_vortexView);
    }
}

此代码中的 VortexView 存在问题。 Eclipse 告诉我 VortexView 无法解析为类型。

有什么解决办法吗?

最佳答案

您的项目中是否有 VortexView 类,如果有,ctrl+shift+O 将解决问题。否则将类/jar 添加到 classpaht 并执行 ctrl+shift+O(组织导入)。

关于Android无法解析为类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9051976/

相关文章:

Eclipse 上的安卓模拟器

android - List.Remove 始终删除 ListView 的最后一项

Android不可阻挡的应用程序

android - 如何在 Android 应用程序中集成 GitHub 身份验证

android - Gradle 构建 lintVitalRelease NullPointerException

java - OrmLite 级联删除

java - 如何检查房间数据库是否为空

android - 检索 EditText 多行文本,因为它是 android?

android - 为 MapView 中点击的 OverlayItems 创建自定义弹出窗口

java - Android:根据 ListView 中的项目数显示/隐藏菜单项