This file contains hidden or 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 void unbindDrawable(Drawable d) { | |
if (d != null) | |
d.setCallback(null); | |
} |
This file contains hidden or 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 AnySoftKeyboard extends InputMethodService { | |
private static final class KeyboardUIStateHanlder extends Handler { | |
//This will NOT be counted as a reference! | |
private final WeakReference<AnySoftKeyboard> mKeyboard; | |
public KeyboardUIStateHanlder(AnySoftKeyboard keyboard) { | |
mKeyboard = new WeakReference<AnySoftKeyboard>(keyboard); | |
} | |
This file contains hidden or 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
File extFolder = Environment.getExternalStorageDirectory(); | |
File target = new File(extFolder, "ask_mem_dump.hprof"); | |
Debug.dumpHprofData(target.getAbsolutePath()); |
This file contains hidden or 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
package net.evendanan.android.hacks; | |
import android.content.Context; | |
import android.graphics.drawable.Drawable; | |
import android.util.AttributeSet; | |
/**** | |
*Note, this ImageView hack will ALWAYS scale the image (up or down) to fit the available | |
*space, while keeping the image aspect ratio. | |
*/ |
This file contains hidden or 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
function verify_app_store_in_app($receipt, $is_sandbox) | |
{ | |
//$sandbox should be TRUE if you want to test against itunes sandbox servers | |
if ($is_sandbox) | |
$verify_host = "ssl://sandbox.itunes.apple.com"; | |
else | |
$verify_host = "ssl://buy.itunes.apple.com"; | |
$json='{"receipt-data" : "'.$receipt.'" }'; | |
//opening socket to itunes |
NewerOlder