當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。