custom tab title in android -


i setting custom title in tab activity this

    boolean customtitlesupported;     customtitlesupported = requestwindowfeature(window.feature_custom_title);   //  customtitlesupported = false;    //check custom title supported feature        if(customtitlesupported == true) {         customtitlebar();     } else {         requestwindowfeature(window.feature_left_icon);         string title = prefmanager.gettitle();         settitle(name + " " + title);     }     //set contentview of activity       setcontentview(r.layout.tabactivity);        if(customtitlesupported == false){         setfeaturedrawableresource(window.feature_left_icon, r.drawable.logo);     } 

everything working fine.but when make customtitlesupported false check if custom title support not there in sdk should call normal settitle() function. if customtitlesupported = false; getting following error

android.util.androidruntimeexception: cannot combine custom titles other title   features 

i not understanding problem if custom title not supported why cannot request other title features.if doest not request custom title else part of setting icon , title works want handle both conditions together.

thanks

you canot use other title features feature_custom_title, , cannot turn off feature once requested: check doc

you have use setfeatureint(int featureid, int value) , provide layout resource id @ "value". check example: http://developer.android.com/resources/samples/apidemos/src/com/example/android/apis/app/customtitle.html


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -