Skip to content

Instantly share code, notes, and snippets.

@daichan4649
daichan4649 / list_item.xml
Created Nov 22, 2011
customize fastScroller(change overlay and scroller) for Android
View list_item.xml
// 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 Jan 25, 2012
AsyncTaskTest(API Level under 13 ,over 13)
View AndroidManifest.xml
<?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 Jan 25, 2012
The difference between Gingerbread and ICS of AsyncTask's Executor
View gb.java
// 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);
View MainActivity.java
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 {
View MainActivity.java
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 Mar 3, 2016
AsyncTask sample (non-retain Fragment)
View MainActivity.java
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 {
View ListTestActivity.java
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 Jul 3, 2012
縦横切替で ListView/GridView を切り替える(表示用データは毎回再生成しない)
View ConfigChangeTestActivity.java
package test.fragment.configchange;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Bundle;
/**
* 縦横切替で ListView/GridView を切り替えるサンプル
* (表示用データは毎回再生成しない)
View CustomImageView.java
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;
View AndroidManifest.xml
<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" />
You can’t perform that action at this time.