Fragment onContextItemSelected - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Fragment onContextItemSelected method.

This code example shows how to use the following methods:getActivity, onContextItemSelected
 
    @Override 
    public boolean onContextItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case PLAY_SELECTION:
                long[] list = MusicUtils.getSongListForGenre(getActivity(),
                        Long.parseLong(mCurrentGenreId));
                MusicUtils.playAll(getActivity(), list, 0);
                break; 
            default: 
                break; 
        } 
        return super.onContextItemSelected(item);
    } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:onContextItemSelected
                return true; 
            case EDIT_ID:
            	((MainActivity)getActivity()).editTransaction(((AdapterContextMenuInfo)item.getMenuInfo()).id);
            	return true; 
        } 
        return super.onContextItemSelected(item);
    } 
	 
	@Override 
	public void onResume(){ 
		super.onResume(); 
		resumed = true;
		updateBalance(); 
		updateTransactionList(dbHelper.fetchAllTransactions());
	} 
	 
	private void updateTransactionList(Cursor c){
		final ListView list = (ListView)getView().findViewById(R.id.mainList);
		list.setAdapter(new RecentCursorAdapter(getActivity(),c));
	} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:onContextItemSelected
        return super.onOptionsItemSelected(item);
    } 
 
    @Override 
    public boolean onContextItemSelected(MenuItem item) {
        return super.onContextItemSelected(item);
    } 
 
    protected void log(String message) {
		new Util().log(message);
    } 
 
    protected void log(String format, Object... args) {
    	new Util().log( String.format(format, args));	
    } 
 
    protected void log(String message, Exception ex) {
    	new Util().log(message, ex);
    } 
 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:onContextItemSelected
ClipboardManager clipboard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
            clipboard.setText(codeText.getText());
            return true; 
        } 
        return super.onContextItemSelected(mi);
    } 
 
} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:onContextItemSelected
	} 
	 
	@Override 
	public boolean onContextItemSelected(MenuItem item) {
		return(applyMenuChoice(item) ||
  		super.onContextItemSelected(item));
  } 
 
	private boolean applyMenuChoice(MenuItem item) {
		subject_av.setText(item.getTitle());
		return true; 
	} 
} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
onContextItemSelected Method Overview
This hook is called whenever an item in a context menu is selected.
See Code Examples for other Android Fragment Methods: