1, Sharedpreferences Prefs.edit (). putstring ("SHAKE", Object.getstring ("SHAKE")).commit ();Sharedpreferences When the value is stored, put in, must commit, otherwise it will not take effect.
2. Thread new Thread () {public void Run () { 。。。。。 }; }.start ();thread, a long time ago I new a thread, the result forget start, I tangled for a long time ... Only to find that there was no start. Later, I remember the thread to start, the result forgot to run, in-line write what code all error, finally found that there is no run.
3, Toast Toast.maketext (Getapplicationcontext (), err_msg, Toast.length_long).Show ();toast, many times I use toast as a user friendly hint. Strange things just happened, I have written toast, the results did not pop out. At first, I thought it was the context, so I tried the current activity contexts and getapplicationcontext, or did not bounce out. The last discovery was to forget the show. Ah, how painful the understanding ...
4, Asynctask new Asyncgetimages ().execute (jsonurl); asynchronous task class, new after, to execute.
Some details that need attention; some small mistakes, hard to detect (Android sharedpreferences, Thread, Toast, Asynctask)