Search code examples
androiddateactionbarsherlock

Android Sherlock ActionBar date


When I didn't install Android Sherlock ActionBar. I had date in my ActionBar. This was a code:

ActionBar actionBar = getActionBar();
String dateString = android.text.format.DateFormat.format("yyyy-MM-dd", new java.util.Date());
actionBar.setTitle(dateString);

Now when I have Sherlock I can not use this code because it does not work. How can I set date Sherlock ActionBar?


Solution

  • You should use getSupportActionBar() when you have ABS library implemented in your project!

    ABS Library Usage