Selaa lähdekoodia

改一些barcode.lenght()>=73 变为barcode.substring(0, 4).equals("http")

李士越 1 vuosi sitten
vanhempi
commit
d9b9b68630

+ 2 - 2
src/com/jiaju/activity/ExternalPackingBarcodePrintActivity.java

@@ -221,7 +221,7 @@ public class ExternalPackingBarcodePrintActivity extends Activity {
 						} 
 						barcodeInfoListAdapter.notifyDataSetChanged();
 					}
-					if(barcode.length() >= 73)
+					if(barcode.substring(0, 4).equals("http"))
 											{
 												String[] parts = barcode.split("-", 2); // 第二个参数限制分割后的数组长度,这里为2  
 												  
@@ -348,7 +348,7 @@ public class ExternalPackingBarcodePrintActivity extends Activity {
 								}
 								barcodeInfoListAdapter.notifyDataSetChanged();
 							}
-							if(barcode.length() >= 73)
+							if(barcode.substring(0, 4).equals("http"))
 							{
 							  String[] parts = barcode.split("-", 2); // 第二个参数限制分割后的数组长度,这里为2  
 							if (parts.length == 2) {  

+ 4 - 4
src/com/jiaju/activity/PieceActivity.java

@@ -660,8 +660,8 @@ public class PieceActivity extends Activity {
 			public void afterTextChanged(Editable arg0) {
 				if (barcode.getText().toString().contains("\n")) {
 					String etcode = barcode.getText().toString().trim()
-							.replaceAll("\\n", "");
-					 if(etcode.length() >= 73)
+							.replaceAll("\\n", "").replaceAll("\n", "");
+					 if(etcode.substring(0, 4).equals("http"))
 						 					{
 						  						String[] parts = etcode.split("-", 2);   
 						 				        if (parts.length == 2) {   
@@ -905,8 +905,8 @@ public class PieceActivity extends Activity {
 							return true;
 						}
 
-						String etcode = barcode.getText().toString().trim().replaceAll("\\n", "");
-						if(etcode.length() >= 73)
+						String etcode = barcode.getText().toString().trim().replaceAll("\\n", "").replaceAll("\n", "");
+						if(etcode.substring(0, 4).equals("http"))
 							 			{
 							 				String[] parts = etcode.split("-", 2);   
 							 		        if (parts.length == 2) {   

+ 3 - 3
src/com/jiaju/activity/ProductPathActivity.java

@@ -232,7 +232,7 @@ public class ProductPathActivity extends Activity {
 		 return source.length() < 1 ? dest.subSequence(dstart, dend): "";
 		 }
 		 } });
-		 if(barcode.length() >= 73)
+		 if(barcode.substring(0, 4).equals("http"))
 			  			{
 			 				String[] parts = barcode.split("-", 2); // 第二个参数限制分割后的数组长度,这里为2  
 			  				  
@@ -300,7 +300,7 @@ public class ProductPathActivity extends Activity {
 							return source.length() < 1 ? dest.subSequence(dstart, dend) : "";
 						}
 					} });
-					 if(barcode.length() >= 73)
+					 if(barcode.substring(0, 4).equals("http"))
 			  			{
 			 				String[] parts = barcode.split("-", 2); // 第二个参数限制分割后的数组长度,这里为2  
 			  				  
@@ -627,7 +627,7 @@ public class ProductPathActivity extends Activity {
 						return source.length() < 1 ? dest.subSequence(dstart, dend) : "";
 					}
 				} });
-				if(barcode.length() >= 73)
+				if(barcode.substring(0, 4).equals("http"))
 					 			{
 					 				String[] parts = barcode.split("-", 2); // 第二个参数限制分割后的数组长度,这里为2