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


Java ContextMenu.setHeaderTitle方法代码示例

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


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

示例1: onCreateContextMenu

import android.view.ContextMenu; //导入方法依赖的package包/类
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
    ContextMenuInfo menuInfo) {
  if (v.getId() != R.id.accounts_list) {
    return;
  }

  AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
  Account account = (Account) adapter.getItem(info.position);
  menu.setHeaderTitle(account.toString());

  String[] menuItems = getResources().getStringArray(R.array.account_actions);
  for (int i = 0; i < menuItems.length; i++) {
    menu.add(Menu.NONE, i, i, menuItems[i]);
  }
}
 
开发者ID:sdrausty,项目名称:buildAPKsSamples,代码行数:17,代码来源:AccountsActivity.java

示例2: onCreateContextMenu

import android.view.ContextMenu; //导入方法依赖的package包/类
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    if (!canCreateContextMenu(menu, menuInfo)) {
        return;
    }
    menu.clear();
    ViewHolder holder = (ViewHolder) ((AdapterContextMenuInfo) menuInfo).targetView.getTag();
    menu.setHeaderTitle(holder.nameView.getText());
    if (holder.icon != null) {
        setHeaderIcon(menu, holder.icon);
    }
    menu.add(Menu.NONE, R.string.app_info, Menu.NONE, R.string.app_info);
    updatePreventMenu(menu, holder.packageName);
    if (getMainIntent(holder.packageName) != null) {
        menu.add(Menu.NONE, R.string.open, Menu.NONE, R.string.open);
    }
    if (holder.canUninstall) {
        menu.add(Menu.NONE, R.string.uninstall, Menu.NONE, R.string.uninstall);
    }
    if (appNotification) {
        menu.add(Menu.NONE, R.string.app_notifications, Menu.NONE, R.string.app_notifications);
    }
}
 
开发者ID:brevent,项目名称:prevent,代码行数:24,代码来源:PreventFragment.java

示例3: onCreateContextMenu

import android.view.ContextMenu; //导入方法依赖的package包/类
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    //clear menu
    if (menu.size() != 0) {
        menu.clear();
    }

    int id_view = v.getId();

    switch (id_view) {
        case R.id.arrow:
            List<Subject> subjects = getSubjectList();
            if (subjects.size() == 0) {
                FunctionHelper.makeSToast(mContext, mResources.getString(R.string.no_data_available));
            } else {
                for (Subject s : subjects) {
                    //Add menu item with groupId
                    menu.add(ID_GROUP_SUBJECT, s.getSubject_id(), s.getSubject_id(), s.getSubject_name());
                }
                menu.setHeaderTitle(R.string.choose_a_subject);
            }
            break;
    }
}
 
开发者ID:nhocga1995s,项目名称:MyCalendar,代码行数:26,代码来源:WeekLessonDetailActivity.java

示例4: onCreateContextMenu

import android.view.ContextMenu; //导入方法依赖的package包/类
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    final SipProfile account = profileFromContextMenuInfo(menuInfo);
    if(account == null) {
        return;
    }
    WizardInfo wizardInfos = WizardUtils.getWizardClass(account.wizard);

    // Setup the menu header
    menu.setHeaderTitle(account.display_name);
    if(wizardInfos != null) {
        menu.setHeaderIcon(wizardInfos.icon);
    }
    
    menu.add(0, MENU_ITEM_ACTIVATE, 0, account.active ? R.string.deactivate_account
            : R.string.activate_account);
    menu.add(0, MENU_ITEM_MODIFY, 0, R.string.modify_account);
    menu.add(0, MENU_ITEM_DELETE, 0, R.string.delete_account);
    menu.add(0, MENU_ITEM_WIZARD, 0, R.string.choose_wizard);

}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:23,代码来源:AccountsEditListFragment.java

示例5: onCreateContextMenu

import android.view.ContextMenu; //导入方法依赖的package包/类
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo)
{
    try
    {
        AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
        if (info != null)
        {
            fileListView.setSelection(info.position, 0);
        }
        menu.setHeaderTitle(R.string.fman_operation);
        AdapterIf ca = getListAdapter();
        ca.populateContextMenu(menu, info, fileListView.getSelected());
    }
    catch (Exception e)
    {
        e.printStackTrace();
    }
}
 
开发者ID:mkulesh,项目名称:microMathematics,代码行数:20,代码来源:Commander.java

示例6: onCreateContextMenu

import android.view.ContextMenu; //导入方法依赖的package包/类
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    menu.setHeaderTitle(R.string.trans_menu_title);
    menu.add(0, 100, 0, R.string.trans_menu_changename);//groupId, itemId, order, title
    menu.add(0, 101, 0, R.string.trans_menu_viewreceiver);
    menu.add(0, 102, 0, R.string.trans_menu_openinb);
}
 
开发者ID:manuelsc,项目名称:Lunary-Ethereum-Wallet,代码行数:8,代码来源:FragmentTransactionsAbstract.java

示例7: onCreateContextMenu

import android.view.ContextMenu; //导入方法依赖的package包/类
@Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    AdapterContextMenuInfo info = (AdapterContextMenuInfo) menuInfo;
    getMenuInflater().inflate(R.menu.folder_context, menu);

    FolderInfoHolder folder = (FolderInfoHolder) mAdapter.getItem(info.position);

    menu.setHeaderTitle(folder.displayName);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:10,代码来源:FolderList.java

示例8: onCreateContextMenu

import android.view.ContextMenu; //导入方法依赖的package包/类
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
        ContextMenuInfo menuInfo)
{
    Log.v(L.TAG, "ItemsListReactor.onCreateContextMenu()");
    
    AdapterContextMenuInfo ctxMenuInfo = (AdapterContextMenuInfo)menuInfo;
    ListView listView = (ListView)findViewById(R.id.ItemsListView);
    ctxItem = (ItemDesc)listView.getItemAtPosition(ctxMenuInfo.position);

    menu.setHeaderTitle("Item Options");
    menu.add(Menu.NONE, EDIT_ITEM, Menu.NONE, "Edit");
    menu.add(Menu.NONE, DELETE_ITEM, Menu.NONE, "Delete");
    String toggleText;
    if(ctxItem.isStar())
    {
        toggleText = "Remove Star";
    }
    else
    {
        toggleText = "Add Star";
    }
    menu.add(Menu.NONE, TOGGLE_STAR, Menu.NONE, toggleText);
    if(dataViewer.getListData().size() > 1)
    {
        menu.add(Menu.NONE, MOVE_ITEM, Menu.NONE, "Move To");
    }
}
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:29,代码来源:SimplyDoActivity.java

示例9: onCreateContextMenu

import android.view.ContextMenu; //导入方法依赖的package包/类
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    BreventActivity activity = (BreventActivity) mFragment.getActivity();
    menu.setHeaderTitle(label);
    menu.add(Menu.NONE, R.string.context_menu_select, Menu.NONE,
            activity.getString(R.string.context_menu_select));
    menu.add(Menu.NONE, R.string.context_menu_package_name, Menu.NONE,
            activity.getString(R.string.context_menu_package_name));
    menu.add(Menu.NONE, R.string.context_menu_app_info, Menu.NONE,
            activity.getString(R.string.context_menu_app_info));
    PackageManager packageManager = mFragment.getActivity().getPackageManager();
    if (BuildConfig.APPLICATION_ID.equals(packageName)) {
        menu.add(Menu.NONE, R.string.context_menu_brevent_server_info, Menu.NONE,
                activity.getString(R.string.context_menu_brevent_server_info));
    } else if (packageManager.getLaunchIntentForPackage(packageName) != null) {
        menu.add(Menu.NONE, R.string.context_menu_open, Menu.NONE,
                activity.getString(R.string.context_menu_open));
    }
    if (activity.isBrevent(packageName)) {
        if (activity.isPriority(packageName)) {
            menu.add(Menu.NONE, R.string.context_menu_unset_priority, Menu.NONE,
                    activity.getString(R.string.context_menu_unset_priority));
        } else {
            menu.add(Menu.NONE, R.string.context_menu_set_priority, Menu.NONE,
                    activity.getString(R.string.context_menu_set_priority));
        }
    }
    if (activity.hasOps(packageName)) {
        menu.add(Menu.NONE, R.string.context_menu_appops, Menu.NONE,
                activity.getString(R.string.context_menu_appops));
    }
    int size = menu.size();
    for (int i = 0; i < size; ++i) {
        menu.getItem(i).setOnMenuItemClickListener(this);
    }
    String important = activity.getLabel("", packageName);
    if (!TextUtils.isEmpty(important)) {
        menu.add(AppsLabelLoader.trim(important));
    }
}
 
开发者ID:brevent,项目名称:Brevent,代码行数:41,代码来源:AppsItemViewHolder.java

示例10: onCreateContextMenu

import android.view.ContextMenu; //导入方法依赖的package包/类
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    if (mLastSelectedQuery != null) {
        getActivity().getMenuInflater().inflate(R.menu.context_history, menu);
        menu.setHeaderTitle(mLastSelectedQuery.getData().getLocalizedName());
    }
}
 
开发者ID:hyperrail,项目名称:hyperrail-for-android,代码行数:9,代码来源:LiveboardSearchFragment.java

示例11: onCreateContextMenu

import android.view.ContextMenu; //导入方法依赖的package包/类
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    if (v.getId() == android.R.id.list) {
        menu.setHeaderTitle(getResources().getText(R.string.note_context_menu));
        getMenuInflater().inflate(R.menu.context_menu, menu);
    }
}
 
开发者ID:coffeeplanter,项目名称:SimpleNotes,代码行数:9,代码来源:MainActivity.java

示例12: onCreateContextMenu

import android.view.ContextMenu; //导入方法依赖的package包/类
@Override
public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo contextMenuInfo) {
    menu.setHeaderTitle((String) ((Object[])btnMore.getTag())[0]);
    Intent data = new Intent();
    data.putExtra(GroupFragment.CONTEXT_MENU_KEY_INTENT_DATA_POS, (Integer) ((Object[])btnMore.getTag())[1]);
    menu.add(Menu.NONE, GroupFragment.CONTEXT_MENU_EDIT, Menu.NONE, "Edit group").setIntent(data);
    menu.add(Menu.NONE, GroupFragment.CONTEXT_MENU_DELETE, Menu.NONE, "Delete group").setIntent(data);
    menu.add(Menu.NONE, GroupFragment.CONTEXT_MENU_LEAVE, Menu.NONE, "Leave group").setIntent(data);
}
 
开发者ID:ansarisufiyan777,项目名称:Show_Chat,代码行数:10,代码来源:GroupFragment.java

示例13: onCreateContextMenu

import android.view.ContextMenu; //导入方法依赖的package包/类
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    menu.setHeaderTitle("Select action");
    menu.add(0, 1, 1, "Edit");
    menu.add(0, 2, 2, "Delete");
}
 
开发者ID:CMPUT301F17T29,项目名称:HabitUp,代码行数:8,代码来源:ViewHabitActivity.java

示例14: onCreateContextMenu

import android.view.ContextMenu; //导入方法依赖的package包/类
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
    super.onCreateContextMenu(menu, v, menuInfo);
    menu.setHeaderTitle(R.string.manage_identities_context_menu_title);
    getMenuInflater().inflate(R.menu.manage_identities_context, menu);
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:7,代码来源:ManageIdentities.java

示例15: onCreateContextMenu

import android.view.ContextMenu; //导入方法依赖的package包/类
public void onCreateContextMenu(ContextMenu menu, View view,
                                ContextMenu.ContextMenuInfo menu_info) {
  menu.setHeaderTitle("Options");
  menu.add(0, 0, 0, "Delete");
}
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:6,代码来源:Export.java


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