Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9302539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:16:48+00:00 2026-06-18T23:16:48+00:00

i want to work with action bar in android. for this i use getActionBar().setHomeButtonEnabled(true);

  • 0

i want to work with action bar in android.
for this i use

getActionBar().setHomeButtonEnabled(true);

below the SetContentView . but is gives me null pointer exception.
when i try only getActionBar() it works fine.

please help me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T23:16:50+00:00Added an answer on June 18, 2026 at 11:16 pm

    If your activity does not have a title bar the method getActionBar() can return null.

    You have two options to fix this:

    1- Add getWindow().requestFeature(Window.FEATURE_ACTION_BAR); before setContentView

    2- In your Manifest specify a Theme that supports ActionBar

    Also make sure that you are targeting the right android version e.g. <uses-sdk android:minSdkVersion="11" />

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to display a progress bar while doing some work, but that would
I want to enable the home button in the Action bar. I'm using this
Hi I want to work around a 'bug' in certain RSS-feeds , which use
I am working in an android application and I want to work fetch details
So, this fiddle: http://jsfiddle.net/aXsWz/31/ actually works how I want things to work. However, that
I got few Activities that use @android:style/Theme.Holo.Light.NoActionBar as theme. API levels above 11 work
I've trying to work around this on the actionbar but from What I can
The navigation bar can response the pan gestures in ZUUIRevealController. But I want to
I want to push root view controller. Why doesn't this code work? RootController *rootController
I'm attempting to display an action bar with two items, Cancel and Save, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.