应用程序Hello World for android出错

时间:2013-09-21 20:48:42

标签: android intellij-idea

我得到了这个错误

package android.app does not exist

cannot find symbol
symbol: class Activity

symbol  : class Bundle
location: class com.example.Hello_World_.MyActivity

symbol  : method setContentView(int)
location: class com.example.Hello_World_.MyActivity

symbol  : variable super
location: class com.example.Hello_World_.MyActivity

method does not override or implement a method from a supertype

我应该添加库吗?如果是的话,我是怎么做到的?

非常感谢。

代码:

package com.example.Hello World;

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

public class MyActivity extends Activity {
    /**
     * Called when the activity is first created.
     */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }
}

0 个答案:

没有答案