¡@

Home 

2014/10/16 ¤W¤È 08:20:42

android Programming Glossary: observable

Android - Unzip a folder?

http://stackoverflow.com/questions/5028421/android-unzip-a-folder

java.io.File import java.io.FileOutputStream import java.io.IOException import java.util.Enumeration import java.util.Observable import java.util.zip.ZipEntry import java.util.zip.ZipFile import org.apache.commons.io.IOUtils import android.os.AsyncTask.. import org.apache.commons.io.IOUtils import android.os.AsyncTask import android.util.Log public class UnZipper extends Observable private static final String TAG UnZip private String mFileName mFilePath mDestinationPath public UnZipper String fileName..

Do some Android UI stuff in non-UI thread

http://stackoverflow.com/questions/6223389/do-some-android-ui-stuff-in-non-ui-thread

main activity sorry I couldnt get the formatting right but im sure you get the idea public class WorkerThread extends Observable implements Runnable public void run try DoSomething String response Doing something setChanged notifyObservers response.. public class MainActivity public class ResponseHandler implements Observer private String resp public void update Observable obj Object arg if arg instanceof String resp String arg Write message to UI here ie System.out.println nReceived Response..

onDestroy gets called each time the screen goes on

http://stackoverflow.com/questions/6772988/ondestroy-gets-called-each-time-the-screen-goes-on

newConfig Log.v ### onConfigurationChanged super.onConfigurationChanged newConfig @Override public void update Observable observable Object data Log.v ### notifyManager.getWho made an Update private void initializeSidebarTabhost TabSpec 1 tabHost.newTabSpec..

How to manage multiple Async Tasks efficiently in Android

http://stackoverflow.com/questions/9221343/how-to-manage-multiple-async-tasks-efficiently-in-android

improve this question You could make a AsyncTask pool object that allows you to spoof a 'batch' http call. create an Observable collection of AsyncTasks i'll refer to this collection as your Pool your Activity creates the AsyncTasks but not execute..