Skip to content

Instantly share code, notes, and snippets.

package com.example.checkableviews;
/*******************************************************************************
* Copyright 2013 Chris Banes.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@hl5pma
hl5pma / gist:6518622
Created September 11, 2013 02:18 — forked from skyisle/gist:3870191
try {
// force to use overflow menu
ViewConfiguration config = ViewConfiguration.get(this);
Field menuKeyField = ViewConfiguration.class
.getDeclaredField("sHasPermanentMenuKey");
if (menuKeyField != null) {
menuKeyField.setAccessible(true);
menuKeyField.setBoolean(config, false);
}
} catch (Exception ex) {