我正在从一个简单的“你好世界”教程,然后修改成我想要的应用程序。我一开始在hello world应用程序中添加了一个按钮,现在我正在尝试响应按钮事件等。
但是当我编译时,我得到一个错误:“package andriod.widget不存在\n import andriod.widget.button;”
代码是

package com.luke.bowls;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import andriod.widget.Button;

public class Bowls extends Activity
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
                final Button button = (Button)findViewById(R.id.android_button);
                button.setOnClickListener(new OnClickListener() {
                    public void onClick(View v) {
                        // Perform action on clicks
                    }
                });
    }
}

这看起来像是一个库引用问题,但大多数构建代码都对我隐藏起来,所以我不知道该如何修复它。

最佳答案

你把安卓拼错了…

10-07 19:39
查看更多