[英]I have some problems with ActionBarActivity in Android Studio
I'm trying a calendar apps in Android Studio.我正在 Android Studio 中尝试日历应用程序。
I cloned it from github and now I have some problems.我从github克隆它,现在我遇到了一些问题。
I imported android.support.v7.app.ActionBarActivity
but it keeps showing the message:我导入了
android.support.v7.app.ActionBarActivity
但它一直显示消息:
Cannot resolve symbol 'ActionBarActivity'
And there is also a warning message that says:还有一条警告消息说:
Can't start Git: D:\tests\simple\settings.gradle Probably the path to Git executable is not valid. Fix it.
How can I fix these problem?我该如何解决这些问题? Please help me.
请帮我。
The ActionBarActivity is included in the AppCompat support Library . ActionBarActivity包含在AppCompat 支持库中。
To use it, you have to add the appcompat library in your project .要使用它,您必须在项目中添加 appcompat 库。
If you are using Android Studio, just add a dependency in your build.gradle
如果您使用的是 Android Studio,只需在
build.gradle
添加一个依赖build.gradle
dependencies {
// Support Libraries (it requires api 23 to compile)
compile 'com.android.support:appcompat-v7:23.1.0'
}
If you are using Eclipse you can read this official link .如果您使用的是 Eclipse,您可以阅读此官方链接。
Also pay attention.还要注意。
This class is deprecated.该类已弃用。
Use AppCompatActivity instead.请改用AppCompatActivity 。
If you have added your dependency to build.gradle
, run a Gradle Sync.如果您已将依赖项添加到
build.gradle
,请运行 Gradle 同步。 Also note the ActionBarActivity
is deprecated, because it has been replaced by AppCompatActivity
.另请注意
ActionBarActivity
已弃用,因为它已被AppCompatActivity
取代。
Android has deprecated ActionBar
. Android 已弃用
ActionBar
。 Instead, try to use ToolBar
which gives you more flexibility than ActionBar
and extend AppCompactActivity
instead of ActionbarActivity
.相反,尝试使用
ToolBar
,它比ActionBar
为您提供更多的灵活性并扩展AppCompactActivity
而不是ActionbarActivity
。 This will solve your problem for sure.这肯定会解决您的问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.