Java Code Examples for android.support.v7.app.AppCompatActivity#supportInvalidateOptionsMenu()

The following examples show how to use android.support.v7.app.AppCompatActivity#supportInvalidateOptionsMenu() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DiscussionDetailFragment.java    From SteamGifts with MIT License 6 votes vote down vote up
public void onPostDiscussionLoaded(Discussion discussion, boolean ignoreExisting) {
    // Called this twice, eh...
    if (this.discussion instanceof Discussion && !ignoreExisting)
        return;

    this.discussion = discussion;
    discussionCard.setDiscussion(discussion);

    AppCompatActivity activity = (AppCompatActivity) getActivity();
    if (activity != null) {
        ActionBar actionBar = activity.getSupportActionBar();
        if (actionBar != null) {
            actionBar.setTitle(getTitle());
        }
        activity.supportInvalidateOptionsMenu();
    }
}
 
Example 2
Source File: RouteDetails.java    From Androzic with GNU General Public License v3.0 5 votes vote down vote up
private void updateRouteDetails()
{
	AppCompatActivity activity = (AppCompatActivity) getActivity();
	activity.getSupportActionBar().setTitle(navigation ? "\u21d2 " + route.name : route.name);
	
	adapter = new WaypointListAdapter(activity, route);
	setListAdapter(adapter);
	
	if (navigation)
		getListView().setSelection(application.navigationService.navRouteCurrentIndex());

	activity.supportInvalidateOptionsMenu();
}