編輯:關於Android編程
粘貼項目中代碼,你應該可以看得懂的!
@Override public boolean dispatchTouchEvent(MotionEvent ev) { // TODO Auto-generated method stub // Toast.makeText(getApplicationContext(), "操作ing", Toast.LENGTH_SHORT) // .show(); // Log.i(TAG, "操作ing"); resetTime(); return super.dispatchTouchEvent(ev); } private void resetTime() { // TODO Auto-generated method stub mHandler.removeMessages(SHOW_ANOTHER_ACTIVITY);//從消息隊列中移除 Message msg = mHandler.obtainMessage(SHOW_ANOTHER_ACTIVITY); mHandler.sendMessageDelayed(msg, 1000*60*1);//無操作5分鐘後進入屏保 } private Handler mHandler = new Handler() { @Override public void handleMessage(Message msg) { // TODO Auto-generated method stub super.handleMessage(msg); if(msg.what==SHOW_ANOTHER_ACTIVITY) { //跳到activity // Log.i(TAG, "跳到activity"); Intent intent=new Intent(FaultActivity.this,ScreenSaverActivity.class); startActivity(intent); } } };
首先是配置文件: 活動中的代碼如下: package com.itydl.rwinrom;import jav
Activity的啟動;Intent intent = new Intent(this,A.class);startActivity(intent);startActiv
android客戶端生成本地驗證碼主要用來限制用戶隨意按請求按鈕,其實該示例也是來對自定義view的練練手而已,先給出效果圖吧其中可定制:*干擾線數目*干擾點數目*背景顏
一、基礎知識1.Android 進程優先級1.1 進程優先級等級一般分法:- Activte process- Visible Process- Service proc