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
linear.setDrawingCacheEnabled(true); | |
//you could not use this. | |
//linear.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), | |
// MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); | |
//linear.layout(0, 0, linear.getMeasuredWidth(), linear.getMeasuredHeight()); | |
linear.buildDrawingCache(); | |
//获取显示的内容当成图片来显示。 | |
iv.setImageBitmap(linear.getDrawingCache()); |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 interface AudioOpeateIterface{ | |
public void setPlayCompletionListener(MediaPlayer.OnCompletionListener listener); | |
public void playRecord(String src); | |
public void startRecord(); | |
public String stopRecord(); | |
public void deleteRecord(); |
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
Message.obtain(handler,new Runnable() { | |
@Override | |
public void run() { | |
System.out.println("gone"); | |
viewGroup.getChildAt(i).clearAnimation(); // this is very imporant! clear animation | |
for(int i=0;i!=viewGroup.getChildCount();++i){ | |
if(viewGroup.getChildAt(i).getId() == id){ | |
viewGroup.getChildAt(i).setVisibility(View.VISIBLE); | |
}else{ |
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
TypedArray array = resources.obtainTypedArray(R.array.share_str); | |
Drawable drawable = array.getDrawable(0); | |
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
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import android.app.Activity; | |
import android.os.Bundle; | |
import android.widget.ArrayAdapter; |
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
/* | |
* SingleTraveralRandom.h | |
* | |
* Created on: 2013年11月25日 | |
* Author: houzhi | |
*/ | |
#ifndef SINGLETRAVERALRANDOM_H_ | |
#define SINGLETRAVERALRANDOM_H_ |
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
AAssetDir* assetDir = AAssetManager_openDir(mgr, ""); | |
const char* filename = (const char*)NULL; | |
while ((filename = AAssetDir_getNextFileName(assetDir)) != NULL) { | |
AAsset* asset = AAssetManager_open(mgr, filename, AASSET_MODE_STREAMING); | |
char buf[BUFSIZ]; | |
int nb_read = 0; | |
FILE* out = fopen(filename, "w"); | |
while ((nb_read = AAsset_read(asset, buf, BUFSIZ)) > 0) | |
fwrite(buf, nb_read, 1, out); | |
fclose(out); |
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
# 配置自己的源文件目录和源文件后缀名 | |
MY_FILES_PATH := $(LOCAL_PATH) \ | |
$(LOCAL_PATH)/../../Classes | |
MY_FILES_SUFFIX := %.cpp %.c | |
# 递归遍历目录下的所有的文件 | |
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2)) | |
# 获取相应的源文件 |
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
TypedValue typedValue = new TypedValue(); | |
// ((Activity)context).getTheme().resolveAttribute(android.R.attr.textAppearanceLarge, typedValue, true); | |
int[] textSizeAttr = new int[] { android.R.attr.textSize }; | |
int indexOfAttrTextSize = 0; | |
TypedArray a = context.obtainStyledAttributes(typedValue.data, textSizeAttr); | |
int textSize = a.getDimensionPixelSize(indexOfAttrTextSize, -1); | |
a.recycle(); |
OlderNewer