This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected void onBindView(View view) { | |
super.onBindView(view); | |
View checkboxView = view.findViewById(com.android.internal.R.id.checkbox); | |
if (checkboxView != null && checkboxView instanceof Checkable) { | |
((Checkable) checkboxView).setChecked(mChecked); | |
// ... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from Tony Morris, http://blog.tmorris.net/further-understanding-scalaoption/ | |
// Scala version 2.8.0.final | |
// http://scalacheck.googlecode.com/files/scalacheck_2.8.0-1.8-SNAPSHOT.jar | |
/* | |
Below are 15 exercises. The task is to emulate the scala.Option API | |
without using Some/None subtypes, but instead using a fold (called a | |
catamorphism). | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 1f44e0b6df61729b4fdc7be6fc4ec145bb89a8b9 | |
Author: Logan Johnson <[email protected]> | |
Date: Thu Aug 19 16:11:30 2010 -0400 | |
choose root based on host for each request | |
diff --git a/tim-session-common/src/main/java/com/terracotta/session/SessionFilter.java b/tim-session-common/src/main/java/com/terracotta/session/SessionFilter.java | |
index 6d4f3b4..523945a 100644 | |
--- a/tim-session-common/src/main/java/com/terracotta/session/SessionFilter.java | |
+++ b/tim-session-common/src/main/java/com/terracotta/session/SessionFilter.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Wysie: Workaround for the entry.type bug, since entry.type always returns -1 | |
final Integer type = entryValues.getAsInteger(Phone.TYPE); | |
//Wysie: Bug here, entry.type always returns -1. | |
if (/*entry.type*/type == CommonDataKinds.Phone.TYPE_MOBILE || mShowSmsLinksForAllPhones) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
08-11 08:24:02.239: ERROR/AndroidRuntime(2409): FATAL EXCEPTION: main | |
08-11 08:24:02.239: ERROR/AndroidRuntime(2409): java.lang.NullPointerException | |
08-11 08:24:02.239: ERROR/AndroidRuntime(2409): at com.android.contacts.ViewContactActivity.buildEntries(ViewContactActivity.java:954) | |
08-11 08:24:02.239: ERROR/AndroidRuntime(2409): at com.android.contacts.ViewContactActivity.bindData(ViewContactActivity.java:526) | |
08-11 08:24:02.239: ERROR/AndroidRuntime(2409): at com.android.contacts.ViewContactActivity.considerBindData(ViewContactActivity.java:519) | |
08-11 08:24:02.239: ERROR/AndroidRuntime(2409): at com.android.contacts.ViewContactActivity.access$400(ViewContactActivity.java:106) | |
08-11 08:24:02.239: ERROR/AndroidRuntime(2409): at com.android.contacts.ViewContactActivity$2.onPostExecute(ViewContactActivity.java:380) | |
08-11 08:24:02.239: ERROR/AndroidRuntime(2409): at com.android.contacts.ViewContactActivity$2.onPostExecute(ViewContactActivity.java:349) | |
08-11 08:24:02.239: ERROR/AndroidRunt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Wysie: Workaround for the entry.type bug, since entry.type always returns -1 | |
final Integer type = entryValues.getAsInteger(Phone.TYPE); | |
//Wysie: Bug here, entry.type always returns -1. | |
if (/*entry.type*/type == CommonDataKinds.Phone.TYPE_MOBILE || mShowSmsLinksForAllPhones) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2007 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
07-19 08:33:24.959: ERROR/AndroidRuntime(10952): FATAL EXCEPTION: main | |
java.lang.NullPointerException | |
at android.text.SpannableStringBuilder.<init>(SpannableStringBuilder.java:44) | |
at android.telephony.PhoneNumberUtils.formatNumber(PhoneNumberUtils.java:1068) | |
at com.android.contacts.ui.widget.ReadOnlyContactEditorView.setState(ReadOnlyContactEditorView.java:166) | |
at com.android.contacts.ui.EditContactActivity.bindEditors(EditContactActivity.java:431) | |
at com.android.contacts.ui.EditContactActivity$QueryEntitiesTask.onPostExecute(EditContactActivity.java:257) | |
at com.android.contacts.ui.EditContactActivity$QueryEntitiesTask.onPostExecute(EditContactActivity.java:194) | |
at com.android.contacts.util.WeakAsyncTask.onPostExecute(WeakAsyncTask.java:56) | |
at android.os.AsyncTask.finish(AsyncTask.java:417) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://gist.github.com/b24f5990a675cb1e940a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected boolean persistBoolean(boolean value) { | |
if (shouldPersist()) { | |
if (value == getPersistedBoolean(!value)) { | |
// It's already there, so the same as persisting | |
return true; | |
} | |
SharedPreferences.Editor editor = mPreferenceManager.getEditor(); | |
editor.putBoolean(mKey, value); | |
tryCommit(editor); |