ActionBar in Android Maven Project using Android Support Library v7

孤者浪人 提交于 2019-12-01 01:33:35

Implement ActionBar in 2.2 device and other Functionlity like ViewPager,Framgmet Tag in 2.2 then there is two way using sherlockActionbar and AppCompat

Sherlock is and third party library while AppCompat is Android library.
step to use AppCompact in project

just update android skd-> extra-> Android support library
Then goto you sdk in your system-> Androidsdk\extras\android\support\v7 find appcompat source code. Import this appcompact in you eclipse.
Create you project and select appcompact library from property->android-> Library.
open you manifeast file and change theme **android:theme="@style/Theme.AppCompat.Light**" Then extend your activity with ActionBarActivity if you cannot found it then pls manualy import `

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

Then Add below code to activity

final ActionBar actionBar = getSupportActionBar();
actionBar.setHomeButtonEnabled(false);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!