Last try - see if attached is working for "31". Have changed the Java code to be as follows:
B4X:NFCUtils(final Activity pActivity) { mActivity = pActivity; mNfcAdapter = NfcAdapter.getDefaultAdapter(mActivity); if (Build.VERSION.SDK_INT < 31) { mPendingIntent = PendingIntent.getActivity(mActivity, 0, new Intent(mActivity, mActivity.getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0); } else { mPendingIntent = PendingIntent.getActivity(mActivity, 0, new Intent(mActivity, mActivity.getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 67108864); } }
@agraham , please comment if I have it...
indeed - the same errorAre you sure you are using the new jar posted above. That looks like the original error.
firstly i'm not in position to even comment as i'm not that expert in such thingsI think Johann has put the flag in the wrong place. It should replace the final parameter to getActivity which is still 0 in the jar.
Is that some kind of criticism of my comment? It's not welcome if it is!secondly i trust Johan to find and fix it as he wrote it and responded here to this call for help
Oh no, it's NOTIs that some kind of criticism of my comment? It's not welcome if it is!
NFCUtils(final Activity pActivity) {
mActivity = pActivity;
mNfcAdapter = NfcAdapter.getDefaultAdapter(mActivity);
if (Build.VERSION.SDK_INT < 31) {
mPendingIntent = PendingIntent.getActivity(mActivity, 0,
new Intent(mActivity, mActivity.getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
} else {
mPendingIntent = PendingIntent.getActivity(mActivity, 0,
new Intent(mActivity, mActivity.getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 67108864);
}
}
dearest JohanLast try - see if attached is working for "31". Have changed the Java code to be as follows:
B4X:NFCUtils(final Activity pActivity) { mActivity = pActivity; mNfcAdapter = NfcAdapter.getDefaultAdapter(mActivity); if (Build.VERSION.SDK_INT < 31) { mPendingIntent = PendingIntent.getActivity(mActivity, 0, new Intent(mActivity, mActivity.getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0); } else { mPendingIntent = PendingIntent.getActivity(mActivity, 0, new Intent(mActivity, mActivity.getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 67108864); } }
@agraham , please comment if I have it right/wrong - or if there is a better way to do it.
Thank youThere seems to be onPause and onResume methods in the library which you should be calling anyway. From the look of it you can call onPause any time you want to stop seeing card reads and onResume at any time you want to restart. Try it.
They don't take parameters. You should be calling them in your activity's pause and resume events anyway but it looks like they just turn off and turn on the dispatch of card data events. Intellisense should show you how to call them.I'm afraid I got lost here, just call the subs?
ThanksThey don't take parameters. You should be calling them in your activity's pause and resume events anyway but it looks like they just turn off and turn on the dispatch of card data events. Intellisense should show you how to call them.
tried... failed...They don't take parameters. You should be calling them in your activity's pause and resume events anyway but it looks like they just turn off and turn on the dispatch of card data events. Intellisense should show you how to call them.
'these are hooks to the wrapper as the wrapper uses for eg onNewIntent, onResume, onPause and dont want to extend the wrapper with Activity
#If Java
public void _onnewintent (android.content.Intent intent) {
}
public void _onresume () {
}
public void _onpause () {
}
#End If
You don't. You call them from B4X code as 'onPause' and 'onResume'. As I said above Intellisense should show you them to choose when you type the dot after your TapCard variable name.how do i use these two functions?
thanksYou don't. You call them from B4X code as 'onPause' and 'onResume'. As I said above Intellisense should show you them to choose when you type the dot after your TapCard variable name.
I've no idea about signatures - I've never used the store.
I fail to understand the problem. They are methods declared in the library. Intellisense shows them. You just call them as normal.i couldn't find a way to call these functions as i get errors "not declared"
Sub Globals
'These global variables will be redeclared each time the activity is created.
Dim Card As TapCard
End Sub
Sub Activity_Resume
Card.onResume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
Card.onPause
End Sub
I don't. I program only for myself and family nowadays.how do you let your clients download & install ?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?