Back to project page AmbientAlarmClock.
The source code is released under:
<p align="center"><a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"> <img alt="Creative Commons License" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-sa/4.0...
If you think the Android project AmbientAlarmClock listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package de.lukeslog.alarmclock.actions; // w w w. j a va 2 s . c o m import android.os.Bundle; import java.util.Iterator; import java.util.Set; import java.util.StringTokenizer; import de.lukeslog.alarmclock.support.AlarmClockConstants; import de.lukeslog.alarmclock.support.Logger; /** * Created by lukas on 15.04.14. */ public class ActionConfigBundle { private Bundle content; public static String TAG = AlarmClockConstants.TAG; public ActionConfigBundle() { content=new Bundle(); } public ActionConfigBundle(String semiColonSeparatedData) { content = new Bundle(); Logger.i(TAG, semiColonSeparatedData); StringTokenizer tk = new StringTokenizer(semiColonSeparatedData, ";"); while(tk.hasMoreTokens()) { try { String key = tk.nextToken(); String value = tk.nextToken(); content.putString(key, value); } catch(Exception e) { Logger.d(TAG, "Exception in ActionConfigBundle Constructor"); } } } public void setContent(Bundle content) { this.content = content; } public Bundle getContent() { return content; } @Override public String toString() { return stringRepresentation(content); } public String getString(String key) { return content.getString(key); } public void putString(String key, String value) { content.putString(key, value); } private String stringRepresentation(Bundle content) { String configString =""; Bundle configBundle = content; Set<String> keyset = configBundle.keySet(); Iterator<String> iterator = keyset.iterator(); while(iterator.hasNext()) { String key = iterator.next(); String value = (String) configBundle.get(key); configString=configString+""+key+";"+value+";"; } return configString; } }