ActionBarActivity:不能被解析为一个类型类型、ActionBarActivity

2023-09-12 07:18:19 作者:萝莉味儿软妹酥

我是新来的Andr​​oid编程。我下面本教程添加一个动作条我使用说明的支持Android 2.1及以上一节中Main_Activity。

I am new to android-programming. I am following this tutorial to add an ActionBar to my Main_Activity using the explanation in the "Support Android 2.1 and Above" section.

我跟着本教程中添加库项目。然后添加库,在后点的添加库到你的应用程序项目的:我觉得失去了..主要是因为我没有的添加的由选项本身我的Eclipse。

I followed this tutorial to add a Library-Project. Then after adding the library, at the point "Add the library to your application project: I felt lost .. basically because I don't have the "add" option by itself in my Eclipse ..

不过,我点击了添加库的,并继续前行。

however I clicked on "add library" and moved on ..

现在,当我修改活动 ActionBarActivity

public class MainActivity extends ActionBarActivity { ... }

在我mainActivity.java,它给我的错误(红线娄ActionBarActivity和所有方法的名字和某些功能)..而当我再次更改:

in my mainActivity.java , it gives me error (a red line bellow the ActionBarActivity and all methods' names and some functions) .. and again when i change:

<activity android:theme="@style/Theme.AppCompat.Light" ... >

在清单中,它也给了我一个错误说:没有资源的发现,匹配给定的名字 ..

我完全失去了..我做了什么错?

I am totally lost .. what did I do wrong ?

推荐答案

这听起来并不像你输入正确的尤其是当你说该库在点添加库到应用程序的项目:我觉得失去了..主要是因为我没有本身有添加选项。但是我点击添加库,并继续前行。

It does not sound like you imported the library right especially when you say at the point Add the library to your application project: I felt lost .. basically because I don't have the "add" option by itself .. however I clicked on "add library" and moved on ..

在Eclipse中,你需要为右键单击该项目,转到属性,选择安卓列表中,则添加可添加库

in eclipse you need to right click on the project, go to Properties, select Android in the list then Add to add the library

按照本教程中的文档

http://developer.android.com/tools/support-library/setup.html