- Forum posts: 13
Apr 13, 2016, 9:04:06 AM via Website
Apr 13, 2016 9:04:06 AM via Website
Running any line of code in which getActionBar() is use, causes the app to crash. And yes, I did remember to change:
public class MainActivity extends ActionBarActivity{
to:
public class MainActivity extends Activity{
And I also remembered to remove the import:
import android.support.v7.app.ActionBarActivity;
I don't know if there's something else I need to import to get getActionBar() to work correctly, but I was under the impression that the changes I already made are all I needed to do to get that function working correctly. I'm trying to avoid at all cost the use of getSupportActionBar(), because that is based on an older version of android (3.x.x) that most people don't even still have. Most people have 4.x.x or 5.x.x now. And from my understanding getActionBar has a lot more features available than getSupportActionBar does. The getSupportActionBar() function is ONLY for backward compatibility. And I'm trying to develop all my apps to be compatible for 4.0.0 at the earliest.
Recommended editorial content
With your consent, external content is loaded here.
By clicking on the button above, you agree that external content may be displayed to you. Personal data may be transmitted to third-party providers in the process. You can find more information about this in our Privacy Policy.