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
public interface BackPressedListener { | |
void onBackPressed(); | |
} |
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
public class JSonicTest extends JsonicTestCaseBase { | |
public void testDecodeJson() { | |
for (WebApiType apiType : WebApiType.values()) { | |
String jsonText = createJsonText(apiType); | |
// decode | |
Object o = decodeJson(apiType, jsonText); | |
if (o != null) { | |
} |
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
<resources> | |
<style name="CustomTheme" parent="Theme.Sherlock.Light"> | |
<item name="android:actionBarStyle">@style/custom_actionbar_style</item> | |
</style> | |
<style name="custom_actionbar_style" parent="Widget.Sherlock.Light.ActionBar"> | |
<!-- | |
<item name="android:displayOptions">homeAsUp|useLogo|showHome|showTitle</item> | |
--> | |
<item name="android:displayOptions">useLogo|showTitle</item> |
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
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:gravity="center" | |
android:orientation="vertical" | |
android:padding="24dip" > | |
<TextView | |
android:layout_width="wrap_content" |
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
public class SelectDateDialogFragment extends DialogFragment { | |
public static DialogFragment newInstance() { | |
Bundle args = new Bundle(); | |
DialogFragment fragment = new SelectDateDialogFragment(); | |
fragment.setArguments(args); | |
return fragment; | |
} |
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
public class JsonicUtil { | |
public enum ResponseType { | |
TEST_1(Test1Response.class), ; | |
private Class<? extends JsonResponse> decodeTargetClazz; | |
private ResponseType(Class<? extends JsonResponse> clazz) { | |
this.decodeTargetClazz = clazz; | |
} |
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
// FragmentA (in Activity A) | |
private void showActivityB(int requestCode) { | |
Intent intent = new Intent(getActivity(), ActivityB.class); | |
startActivityForResult(intent, requestCode); | |
} | |
@Override | |
public void onActivityResult(int requestCode, int resultCode, Intent data) { | |
if (resultCode != Activity.RESULT_OK) { | |
return; |
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
private static final String ALGORITHM_SHA1 = "SHA1"; | |
private static final String SALT = "saltvalue"; | |
public static String encode2SHA1Text(String plainText) { | |
return encode2SHA1Text(plainText, ALGORITHM_SHA1, SALT); | |
} | |
public static String encode2SHA1Text(String plainText, String algorithm, String salt) throws NoSuchAlgorithmException { | |
MessageDigest md = MessageDigest.getInstance(algorithm); |
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
adb shell cat /data/data/[packagename]/databases/[dbファイル名] > c:\tmp\data.db |
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
/** | |
* 入力フィルタ(半角英数) | |
* @see <a href="http://y-anz-m.blogspot.jp/2010/10/androidfilter.html">半角英数フィルタ</a> | |
*/ | |
class AlphaNumericFilter implements InputFilter { | |
@Override | |
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { | |
if (source.toString().matches("^[a-zA-Z0-9]+$")) { | |
return source; | |
} else { |