如何获取android手机添加闹钟界面和系统闹钟列表
2个回答
展开全部
final ImageView button4 = (ImageView) findViewById(R.id.button4);
button4.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
//先判断当前触摸的是不是button4,再判断是否是ACTION_DOWN,都满足条件才跳转到闹钟界面
if (v == button4 && event.getAction() == MotionEvent.ACTION_DOWN) {
Intent alarmas = new Intent(AlarmClock.ACTION_SET_ALARM);
return true
}
return false;
}
});
再加上权限
<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
button4.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
//先判断当前触摸的是不是button4,再判断是否是ACTION_DOWN,都满足条件才跳转到闹钟界面
if (v == button4 && event.getAction() == MotionEvent.ACTION_DOWN) {
Intent alarmas = new Intent(AlarmClock.ACTION_SET_ALARM);
return true
}
return false;
}
});
再加上权限
<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
展开全部
final ImageView button4 = (ImageView) findViewById(R.id.button4);
button4.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
//先判断当前触摸的是不是button4,再判断是否是ACTION_DOWN,都满足条件才跳转到闹钟界面
if (v == button4 && event.getAction() == MotionEvent.ACTION_DOWN) {
Intent alarmas = new Intent(AlarmClock.ACTION_SET_ALARM);
return true
}
return false;
}
});
再加上权限
<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
button4.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
//先判断当前触摸的是不是button4,再判断是否是ACTION_DOWN,都满足条件才跳转到闹钟界面
if (v == button4 && event.getAction() == MotionEvent.ACTION_DOWN) {
Intent alarmas = new Intent(AlarmClock.ACTION_SET_ALARM);
return true
}
return false;
}
});
再加上权限
<uses-permission android:name="com.android.alarm.permission.SET_ALARM"/>
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询