Skip to content

Instantly share code, notes, and snippets.

@daichan4649
daichan4649 / list_item.xml
Created November 22, 2011 02:51
customize fastScroller(change overlay and scroller) for Android
// Activity sample
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TestAdapter adapter = new TestAdapter(getApplicationContext(), createBindDataList());
ListView listView = (ListView) findViewById(R.id.listview);
listView.setAdapter(adapter);
@daichan4649
daichan4649 / AndroidManifest.xml
Created January 25, 2012 02:40
AsyncTaskTest(API Level under 13 ,over 13)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.asynctask"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="12" />
<application
android:icon="@drawable/ic_launcher"
@daichan4649
daichan4649 / gb.java
Created January 25, 2012 04:17
The difference between Gingerbread and ICS of AsyncTask's Executor
// android.os.AsyncTask 抜粋
// Executor
private static final ThreadPoolExecutor sExecutor = new ThreadPoolExecutor(CORE_POOL_SIZE,
MAXIMUM_POOL_SIZE, KEEP_ALIVE, TimeUnit.SECONDS, sWorkQueue, sThreadFactory);
// execute
public final AsyncTask<Params, Progress, Result> execute(Params... params) {
// 抜粋
sExecutor.execute(mFuture);
@daichan4649
daichan4649 / MainActivity.java
Created February 23, 2012 03:56
HandlerThread
package test.handler;
import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.view.View;
import android.view.View.OnClickListener;
public class MainActivity extends Activity {
@daichan4649
daichan4649 / MainActivity.java
Created April 17, 2012 12:35
DialogFragment sample
package test.fragment;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
public class MainActivity extends Activity {
@daichan4649
daichan4649 / MainActivity.java
Last active March 3, 2016 09:37
AsyncTask sample (non-retain Fragment)
package test.fragment.asynctask;
import test.fragment.R;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
public class MainActivity extends Activity {
@daichan4649
daichan4649 / ListTestActivity.java
Created June 18, 2012 06:22
ListFragment sample
package test.fragment.list;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Bundle;
public class ListTestActivity extends Activity {
private static final String TAG_LIST = "list";
@daichan4649
daichan4649 / ConfigChangeTestActivity.java
Created July 3, 2012 07:13
縦横切替で ListView/GridView を切り替える(表示用データは毎回再生成しない)
package test.fragment.configchange;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Bundle;
/**
* 縦横切替で ListView/GridView を切り替えるサンプル
* (表示用データは毎回再生成しない)
@daichan4649
daichan4649 / CustomImageView.java
Created July 10, 2012 11:41
ListFragment+LruCache
package test.fragment.list;
import test.fragment.list.ImageFactory.Type;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.util.AttributeSet;
import android.widget.ImageView;
@daichan4649
daichan4649 / AndroidManifest.xml
Created August 3, 2012 10:37
NFC sample(read IDm)
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.nfc"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.NFC" />
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="15" />