我想在我的应用程序中使用本机联系人应用程序的相同行为.具体来说,我想实现向右滑动以及为textmsg向左滑动.我有一个ListView,我设置了arrayAdapter,i'va为onFlingMethod实现了手势检测器.我正确拦截滑动侧,我可以使用Call应用程序.我需要将项目编号(和其他信息)放入Intent,所以我需要获取刷卡项目.在这里我的代码.
public class Contacts extends Activity implements OnGestureListener {
private static final String TAG = "[Contacts]";
ArrayList < ContactInfo > mData;
private static final int SWIPE_MIN_DISTANCE = 120;
private static final int SWIPE_MAX_OFF_PATH = 250;
private static final int SWIPE_THRESHOLD_VELOCITY = 200;
/** Called when the activity is first created. */
private GestureDetector detector = new GestureDetector(this);
Button btnContacts;
Button btnProfile;
Button btnSettings;
ImageButton btnStatus;
HandleServer cubeServer;
Button slideHandleButton;
SlidingDrawer slidingDrawer;
String filter = "n";
ArrayAdapter < ContactInfo > adapter; …Run Code Online (Sandbox Code Playgroud)