is Back Key Up - Android User Interface

Android examples for User Interface:Key Event

Description

is Back Key Up

Demo Code


//package com.java2s;

import android.support.annotation.NonNull;
import android.view.KeyEvent;

public class Main {
    public static boolean isBackKeyUp(@NonNull KeyEvent event) {
        return event.getKeyCode() == KeyEvent.KEYCODE_BACK
                && event.getAction() == KeyEvent.ACTION_UP;
    }/*  w  ww  .  j  ava2s.  co  m*/
}

Related Tutorials