I was just wondering if any of you know how to do this. I have an activity that has a key value pair and I am trying to display an image if the key is equal to a string else don't show any image.
Does anyone know how or where to start with trying to get this to work right?
final String splitedDouble[] = companyString.split(",,");
String[] arrayOfString = { "Beard Vape Co;beard_vape_co", "two;zwei", "three;drei" };
Hashtable<String, String> hashTable = new Hashtable<String, String>();
for(String s: arrayOfString){
String[] array = s.split(";");
String sKey ="", sValue="";
if(array.length > 1){
sKey = array[0]; sValue = array[1];
hashTable.put(sKey, sValue);
if(sKey.toString().equals(liquidCompany)){
imageView.setImageResource(Integer.parseInt("R.drawable." + sValue.toString()));
}
}
This is what I have for the loop