Example usage for android.view MenuItem getClass

List of usage examples for android.view MenuItem getClass

Introduction

In this page you can find the example usage for android.view MenuItem getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:ua.juliazozulia.taskcollector.ui.main.MainActivity.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    int id = item.getItemId();
    switch (id) {
    case R.id.action_filter: {
        Toast.makeText(this, item.getClass().getSimpleName(), Toast.LENGTH_SHORT).show();
        break;//from w w  w.  j  av a2 s  . c o  m
    }
    }
    return super.onOptionsItemSelected(item);
}