这是indexloc提供的服务,不要输入任何密码
Skip to content

Commit cfdcab9

Browse files
Fixed: Exit loop after "android.nfc.tech.Ndef" found in tech list
1 parent 58c272b commit cfdcab9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/src/main/java/com/termux/api/apis/NfcAPI.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,10 @@ public void readNDEFTag(Intent intent, JsonWriter out) throws Exception {
208208
boolean bNdefPresent = false;
209209
String strs[] = tag.getTechList();
210210
for (String s: strs){
211-
if (s.equals("android.nfc.tech.Ndef"))
211+
if (s.equals("android.nfc.tech.Ndef")) {
212212
bNdefPresent = true;
213+
break;
214+
}
213215
}
214216
if (!bNdefPresent){
215217
onUnexpectedAction(out, "Wrong Technology","termux API support only NFEF Tag");
@@ -254,8 +256,10 @@ public void readFullNDEFTag(Intent intent, JsonWriter out) throws Exception {
254256
String strs[] = tag.getTechList();
255257
boolean bNdefPresent = false;
256258
for (String s: strs){
257-
if (s.equals("android.nfc.tech.Ndef"))
259+
if (s.equals("android.nfc.tech.Ndef")) {
258260
bNdefPresent = true;
261+
break;
262+
}
259263
}
260264
if (!bNdefPresent){
261265
onUnexpectedAction(out, "Wrong Technology","termux API support only NFEF Tag");

0 commit comments

Comments
 (0)