How to add ActionBarActivity in Android Project? -


i'm not able add actionbaractivity in android project. there no options of appcpmpat-v7 in of project.

what now?

public class mainactivity extends activity {

@override protected void oncreate(bundle savedinstancestate) {     super.oncreate(savedinstancestate);     setcontentview(r.layout.activity_main);      actionbar mactionbar = getactionbar();     mactionbar.setdisplayshowhomeenabled(false);     mactionbar.setdisplayshowtitleenabled(false);     layoutinflater minflater = layoutinflater.from(this);      view mcustomview = minflater.inflate(r.layout.custom_actionbar, null);     textview mtitletextview = (textview) mcustomview.findviewbyid(r.id.title_text);     mtitletextview.settext("my own title");      imagebutton imagebutton = (imagebutton) mcustomview             .findviewbyid(r.id.imagebutton);     imagebutton.setonclicklistener(new onclicklistener() {          @override         public void oncl`enter code here`ick(view view) {             toast.maketext(getapplication`enter code here`context(), "refresh clicked!",                     toast.length_long).show();         }     });      mactionbar.setcustomview(mcustomview);     mactionbar.setdisplayshowcustomenabled(true); } 

}


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -