java - cannot resolve method getSupportActionBar().setDisplayHomeAsUpEnabled(true); -


i using android studios, however, unable add below 2 methods says cannot resolve them.

 getsupportactionbar().setdisplayhomeasupenabled(true);    getsupportactionbar().settitle("detail") 

;

your issue you not extending appcompatactivity:

change:

 public class first extends fragmentactivity 

with:

 public class first extends appcompatactivity 

as can check in doc getsupportactionbar() method depends on appcompatactivity.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -