如何使用ActionBarActivity,而不是活动工作 [英] How to work with ActionBarActivity instead of Activity

查看:164
本文介绍了如何使用ActionBarActivity,而不是活动工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Eclipse进行Android开发,也是最后一次我和API-17用它几个月前。但今天从安装SDK管理器的新更新的时候,我试图创建一个新项目。与创新后,我的活动,而不是扩大活动的ActionBarActivity。而它的显示错误。任何解决方案?

I am using eclipse for android development and last time I used it couple of months ago with API-17. But today when installing new updates from SDK manager, I am trying to create a new project. And after creation my activity is extending ActionBarActivity instead of activity. And its showing errors. Any solutions?

另外,我得到了下面的2线进口示值误差的:

Plus I got the below 2 lines of importing showing error:

import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;

推荐答案

导入应用程序兼容性库到Eclipse(您可能需要首先从SDK管理器中下载)。 ActionBarActivity工作一样的正常活动,除了一些方法名称稍有不同,例如 getSupportActionBar()而不是 getActionBar() getSupportFragmentManager() getFragmentManager()

Import the AppCompat library into Eclipse (you may have to download it from the SDK Manager first). ActionBarActivity works the same as a normal Activity, except some method names are slightly different, e.g. getSupportActionBar() instead of getActionBar() and getSupportFragmentManager() instead of getFragmentManager().

这篇关于如何使用ActionBarActivity,而不是活动工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆