简体   繁体   中英

setDisplayHomeAsUpEnabled Requires minimum SDK has to be 11

I'm using Android Studio and in my OnCreate method within my apps project, I'm trying to enable the Up function on the action bar. It says it requires minSDk of 11 but mine is 9. I understand, I'm just wondering if there's a way to add this function with a minimum target of 9. I know there's a support library and if that has anything related with the Up function on the action bar.

Current way I'm enabling it

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_result);

    getActionBar().setDisplayHomeAsUpEnabled(true);
}

Use ActionBarActivity class and getSupportActionBar method of this class from android support library v7. See how to add it here support v7 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM