当前位置: 首页>>代码示例>>Java>>正文


Java Activity.invalidateOptionsMenu方法代码示例

本文整理汇总了Java中android.app.Activity.invalidateOptionsMenu方法的典型用法代码示例。如果您正苦于以下问题:Java Activity.invalidateOptionsMenu方法的具体用法?Java Activity.invalidateOptionsMenu怎么用?Java Activity.invalidateOptionsMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.app.Activity的用法示例。


在下文中一共展示了Activity.invalidateOptionsMenu方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onLoadFinished

import android.app.Activity; //导入方法依赖的package包/类
@Override
public void onLoadFinished(Loader<Cursor> cursorLoader, Cursor cursor) {
    /*
     * Swapping instead of changing Cursor here, to keep the old one open.
     * Loader should release the old Cursor - see note in
     * {@link LoaderManager.LoaderCallbacks#onLoadFinished).
     */
    mListAdapter.swapCursor(cursor);

    if (mListAdapter.getCount() > 0) {
        mViewFlipper.setDisplayedChild(0);
    } else {
        mViewFlipper.setDisplayedChild(1);
    }

    Activity activity = getActivity();
    if (activity != null) {
        activity.invalidateOptionsMenu();
    }
}
 
开发者ID:orgzly,项目名称:orgzly-android,代码行数:21,代码来源:ReposFragment.java

示例2: invalidateOptionsMenu

import android.app.Activity; //导入方法依赖的package包/类
static void invalidateOptionsMenu(Activity activity) {
    activity.invalidateOptionsMenu();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:4,代码来源:ActivityCompatHoneycomb.java

示例3: onCreateView

import android.app.Activity; //导入方法依赖的package包/类
@Override
public View onCreateView(final LayoutInflater inflater, final ViewGroup container,
                         final Bundle savedInstanceState) {
    final View view =
            inflater.inflate(R.layout.fragment_saved_entries_recyclerview, container, false);

    final Activity activity = getActivity();

    mRecyclerView = view.findViewById(R.id.SavedEntriesRecyclerView);
    mRecyclerView.setLayoutManager(new CenterLayoutManager(activity));

    mSortOrder = SharedPrefUtils.getInt(activity, KEY_SORT_ORDER);

    if (savedInstanceState == null || !savedInstanceState.getBoolean(KEY_CAN_ACCESS, false)) {
        if (!TextUtils.isEmpty(SharedPrefUtils.getString(activity, KEY_HASHED_PASSWORD))) {
            SavedEntriesPasswordFragment.getInstance()
                    .show(getFragmentManager(), SavedEntriesPasswordFragment.TAG);
        } else {
            SavedEntriesSetupPasswordFragment.getInstance()
                 .show(getFragmentManager(), SavedEntriesSetupPasswordFragment.TAG);
        }
    }

    super.initialize((CoordinatorLayout) view, mRecyclerView);

    activity.invalidateOptionsMenu();

    return view;
}
 
开发者ID:Applications-Development,项目名称:SimpleRssReader,代码行数:30,代码来源:SavedEntriesFragment.java

示例4: hideKeyboard

import android.app.Activity; //导入方法依赖的package包/类
public static void hideKeyboard(Activity activity, EditText editText, int i, String text, String hint) {
    editText.clearFocus();
    editText.setText("Search Here...");
    editText.setHint(hint);
    SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(activity);
    sharedPref.edit().putInt("keyboard", i).apply();
    activity.invalidateOptionsMenu();
    InputMethodManager imm = (InputMethodManager) activity.getSystemService(Context.INPUT_METHOD_SERVICE);
    imm.hideSoftInputFromWindow(editText.getWindowToken(), 0);
}
 
开发者ID:JaeNuguid,项目名称:Kids-Portal-Android,代码行数:11,代码来源:helper_editText.java

示例5: refreshActionBarMenu

import android.app.Activity; //导入方法依赖的package包/类
private void refreshActionBarMenu(Activity activity) {
    activity.invalidateOptionsMenu();
}
 
开发者ID:njitdev,项目名称:sa-android,代码行数:4,代码来源:ClassScheduleActivity.java

示例6: invalidateOptionsMenu

import android.app.Activity; //导入方法依赖的package包/类
@SuppressLint("NewApi")
public void invalidateOptionsMenu(Activity activity) {
	activity.invalidateOptionsMenu();
}
 
开发者ID:starn,项目名称:encdroidMC,代码行数:5,代码来源:EDActionBar.java

示例7: onCreateView

import android.app.Activity; //导入方法依赖的package包/类
@SuppressWarnings({"ConstantConditions", "SuspiciousNameCombination"})
@Override
public View onCreateView(final LayoutInflater inflater,
                         final ViewGroup container,
                         final Bundle savedInstanceState) {
    final View view =
            inflater.inflate(R.layout.fragment_current_feed_recyclerview, container, false);

    final Activity activity = getActivity();

    mSwipeRefreshLayout = view.findViewById(R.id.CurrentFeedSwipeToRefreshLayout);

    if (ThemeUtils.isDarkThemeSelected(activity)) {
        final List<Integer> ids = Arrays.asList(
                R.attr.colorPrimaryViewBackground,
                R.attr.colorAccent);

        TypedValueUtils.resolveResourceIds(activity, ids);

        mSwipeRefreshLayout.setProgressBackgroundColorSchemeColor(
                activity.getColor(ids.get(0)));

        mSwipeRefreshLayout.setColorSchemeResources(ids.get(1));
    } else {
        mSwipeRefreshLayout.setColorSchemeResources(android.R.color.holo_orange_dark,
                android.R.color.holo_green_dark, android.R.color.holo_blue_dark,
                android.R.color.holo_purple, android.R.color.holo_red_dark);
    }

    mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
        @Override
        public void onRefresh() {
            isFeedUpdateAvailable();

        }
    });

    final VerticalSpaceItemDecoration decor =
            new VerticalSpaceItemDecoration(activity, DIVIDER_WIDTH);
    decor.setDrawable(activity.getDrawable(R.drawable.divider));
    mAdapter = new FeedAdapter((MainActivity) activity);

    mRecyclerView = view.findViewById(R.id.CurrentFeedRecyclerView);

    mRecyclerView.setLayoutManager(new CenterLayoutManager(activity));
    mRecyclerView.setAdapter(mAdapter);
    mRecyclerView.addItemDecoration(decor);

    super.initialize((CoordinatorLayout) view, mRecyclerView);

    activity.invalidateOptionsMenu();

    return view;
}
 
开发者ID:Applications-Development,项目名称:SimpleRssReader,代码行数:55,代码来源:CurrentFeedFragment.java


注:本文中的android.app.Activity.invalidateOptionsMenu方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。