Skip to content

Instantly share code, notes, and snippets.

View BartoszJarocki's full-sized avatar

Bartosz Jarocki BartoszJarocki

View GitHub Profile
/**
* Show the activity over the lockscreen and wake up the device. If you launched the app manually
* both of these conditions are already true. If you deployed from the IDE, however, this will
* save you from hundreds of power button presses and pattern swiping per day!
*/
public static void riseAndShine(Activity activity) {
activity.getWindow().addFlags(FLAG_SHOW_WHEN_LOCKED);
PowerManager power = (PowerManager) activity.getSystemService(POWER_SERVICE);
PowerManager.WakeLock lock =
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
public class WCFDateTimeParser {
/**
* <p>WCF services supply Dates over JSON in a strange format. This method
* takes a WCF-formatted Date string and parses it into a JodaTime DateTime
* object. Assumes valid input matching a format described below.</p>
*