Notification action
This commit is contained in:
@ -66,14 +66,21 @@ public class ActivityManageTriggerProfile extends Activity
|
||||
String profileName = values[0];
|
||||
|
||||
List<Profile> profileList = Profile.getProfileCollection();
|
||||
|
||||
boolean found = false;
|
||||
|
||||
for(int i = 0; i < profileList.size(); i++)
|
||||
{
|
||||
if(profileList.get(i).getName().equals(profileName))
|
||||
{
|
||||
spinnerProfiles.setSelection(i);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!found)
|
||||
Miscellaneous.messageBox(getResources().getString(R.string.info), getResources().getString(R.string.profileWasNotFound), ActivityManageTriggerProfile.this).show();
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
|
@ -1647,4 +1647,53 @@ public class Miscellaneous extends Service
|
||||
|
||||
return formattedDate;
|
||||
}
|
||||
|
||||
public static boolean arraySearch(String[] haystack, String needle, boolean caseSensitive, boolean matchFullLine)
|
||||
{
|
||||
if(matchFullLine)
|
||||
{
|
||||
if(caseSensitive)
|
||||
{
|
||||
for (String s : haystack)
|
||||
{
|
||||
if (s.equals(needle))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (String s : haystack)
|
||||
{
|
||||
if (s.toLowerCase().equals(needle.toLowerCase()))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(caseSensitive)
|
||||
{
|
||||
for (String s : haystack)
|
||||
{
|
||||
if (s.contains(needle))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (String s : haystack)
|
||||
{
|
||||
if (s.toLowerCase().contains(needle.toLowerCase()))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean arraySearch(ArrayList<String> requestList, String needle, boolean caseSensitive, boolean matchFullLine)
|
||||
{
|
||||
return arraySearch(requestList.toArray(new String[requestList.size()]), needle, caseSensitive, matchFullLine);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user