ok,现在要设置长按闹钟项实现删除的功能了,比较简单,代码如下:
public class Alarm extends LinearLayout { private Button button; private ListView listView; ArrayAdapter<Alarm.myalarm> adapter; private SharedPreferences sp; private static final String ALARM="myalarm"; public Alarm(Context context) { super(context); } public Alarm(Context context, AttributeSet attrs) { super(context, attrs); } public Alarm(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); } @Override protected void onFinishInflate() { super.onFinishInflate(); button = (Button) findViewById(R.id.btn1); listView = (ListView) findViewById(R.id.list1); adapter = new ArrayAdapter<Alarm.myalarm>(getContext(), android.R.layout.s