react-native-full-image-picker icon indicating copy to clipboard operation
react-native-full-image-picker copied to clipboard

BackHandler.addEventListener('hardwareBackPress', this._clickBack);

Open GuoJiKaiHehe opened this issue 4 years ago • 1 comments

监听安卓返回键,不生效 BackHandler.addEventListener('hardwareBackPress', this._clickBack);

GuoJiKaiHehe avatar Apr 15 '20 16:04 GuoJiKaiHehe

You can try this:

.
.
.

import { useBackHandler } from '@react-native-community/hooks'

.
.
.

useBackHandler(() => {
    //your function
    Alert.alert('Teste')
    
    // Return True will remove BackPress Event, if you set False it will allow it to run your function but will have the BackPress Event anyway.
    return true
  })

@1Nxt @Kiluameta

JairFsl avatar Nov 14 '23 21:11 JairFsl