This file contains 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 boolean onTouch(View v, MotionEvent event) { | |
// TODO Auto-generated method stub | |
if (MotionEvent.ACTION_DOWN == event.getAction()) { | |
if (mCurrentDownEvent != null | |
&& mPreviousUpEvent != null | |
&& isConsiderAsDoubleTap(mCurrentDownEvent, | |
mPreviousUpEvent, event)) { | |
} | |
mCurrentDownEvent = MotionEvent.obtain(event); |
This file contains 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
package net.canking.myanimtest; | |
import java.lang.reflect.InvocationTargetException; | |
import java.lang.reflect.Method; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.content.res.TypedArray; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; |
This file contains 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
private void startSelfService() { | |
// 获得系统级别服务 | |
AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE); | |
Intent in = new Intent(this, this.getClass()); | |
PendingIntent pin = PendingIntent.getService(this, 0, in, | |
PendingIntent.FLAG_UPDATE_CURRENT); | |
// 返回系统开机到现在的时间差 | |
long timePeriod = SystemClock.elapsedRealtime(); | |
// ELAPSED_REALTIME =3s | |
am.setRepeating(AlarmManager.ELAPSED_REALTIME, timePeriod, 3 * 1000, |
This file contains 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
/** | |
* 判断服务是否启动 | |
* | |
* @param className | |
* @return | |
*/ | |
private boolean checkServiceRunning(String className) { | |
boolean isRunning = false; | |
ActivityManager am = (ActivityManager) this | |
.getSystemService(Context.ACTIVITY_SERVICE); |
This file contains 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
//1.消费者,生产者都要实现Runnable接口 | |
//2.要有一个消费的对象,如:面包 | |
//3.模拟一个栈的操作方式,先进后出 | |
//4.线程同步,synchronized,notify,wait | |
public class AJava { |
This file contains 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.Collection; | |
import java.util.*; | |
public class ArrayList_LinkedList { | |
public static final String filePath = "D:/MP"; | |
public static void main(String[] args) { | |
Collection collection = new ArrayList(); |
NewerOlder