android - Possible to prevent app launch by NFC intent from within an app? -
i have app requirements launch on detection of non-ndef nfc tag, i'm using tech_discovered
filter on main activity so:
<intent-filter> <action android:name="android.nfc.action.tech_discovered" /> </intent-filter>
this works fine, users complain phone case doubles holder credit cards / smart cards , hence app unintentionally launching when close phone case. these users don't want have disable device nfc setting (and can't done programmatically) question is: possible programmatically stop app launching nfc intent within app?
the best idea can come have nfc intent launch non-ui activity (one doesn't call setcontentview
) , have check if persistent flag has been set (by ui control in main activity) , if flag set, not launch main activity.
is there easier/more elegant solution?
the app try check whether "discovered" tag belongs app (i.e. datastructure expected, resp. tagtype expected), , if not stop again. whether make visible use or not ...
Comments
Post a Comment