當前位置: 首頁>>代碼示例>>Java>>正文


Java CanceledException.printStackTrace方法代碼示例

本文整理匯總了Java中android.app.PendingIntent.CanceledException.printStackTrace方法的典型用法代碼示例。如果您正苦於以下問題:Java CanceledException.printStackTrace方法的具體用法?Java CanceledException.printStackTrace怎麽用?Java CanceledException.printStackTrace使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.app.PendingIntent.CanceledException的用法示例。


在下文中一共展示了CanceledException.printStackTrace方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: openGps

import android.app.PendingIntent.CanceledException; //導入方法依賴的package包/類
/**
 * 強製幫用戶打開GPS
 * @param context
 */
@SuppressLint("InlinedApi")
public static void openGps(Context context) {
	if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
		Settings.System.putInt(context.getContentResolver(), Settings.Secure.LOCATION_MODE, Settings.Secure.LOCATION_MODE_HIGH_ACCURACY);
	} else {
		Intent i = new Intent();
		i.setClassName("com.android.settings", "com.android.settings.widget.SettingsAppWidgetProvider");
		i.addCategory("android.intent.category.ALTERNATIVE");
		i.setData(Uri.parse("custom:3"));
		try{
			PendingIntent.getBroadcast(context, 0, i, 0).send();
		} catch(CanceledException e) {
			e.printStackTrace();
		}
	}
}
 
開發者ID:WeiChou,項目名稱:Wei.Lib2A,代碼行數:21,代碼來源:GPS.java

示例2: run

import android.app.PendingIntent.CanceledException; //導入方法依賴的package包/類
@Override
public void run() {
	if(password.length() > 4) {
		password = password.substring(0, 4);
	}
	if(password.length() == 4) {
		if(TextUtils.equals(MD5Utils.MD5(password), config.getDigitalPassword())) {
			if(isLaunchCamera) {
				AppUtils.launchCamera(getContext());
			} else if(notification != null) {
				try {
					notification.contentIntent.send();
				} catch (CanceledException e) {
					e.printStackTrace();
				}
			}
			LockerManager.getInstance(getContext()).unlock();
		} else {
			indicator.passwordWrong();
			password = "";
		}
	}
}
 
開發者ID:androidertc,項目名稱:iLocker,代碼行數:24,代碼來源:LockerModeDPicture.java

示例3: onPatternDetected

import android.app.PendingIntent.CanceledException; //導入方法依賴的package包/類
@Override
public void onPatternDetected(List<Cell> pattern) {
	if (pattern == null) {
		return;
	}
	if (TextUtils.equals(MD5Utils.MD5(LockPatternUtils.patternToString(pattern)), config.getPatternPassword())) {
		if(isLaunchCamera) {
			AppUtils.launchCamera(getContext());
		} else if(notification != null) {
			try {
				notification.contentIntent.send();
			} catch (CanceledException e) {
				e.printStackTrace();
			}
		}
		mPatternView.setDisplayMode(LockPicturePatternView.DisplayMode.Right);
		LockerManager.getInstance(getContext()).onUnlock();
		mPatternView.post(mClearPatternRunnable);
	} else {
		mPatternView.setDisplayMode(LockPicturePatternView.DisplayMode.Wrong);
		mPatternView.postDelayed(mClearPatternRunnable, 1000);
		mTVDrawPattern.setText(R.string.password_wrong);
		YoYo.with(Techniques.Shake).duration(1000).playOn(mTVDrawPattern);
	}

}
 
開發者ID:androidertc,項目名稱:iLocker,代碼行數:27,代碼來源:LockerModePPattern.java

示例4: onPatternDetected

import android.app.PendingIntent.CanceledException; //導入方法依賴的package包/類
@Override
public void onPatternDetected(List<Cell> pattern) {
	if (pattern == null) {
		return;
	}
	if (TextUtils.equals(MD5Utils.MD5(LockPatternUtils.patternToString(pattern)), config.getPatternPassword())) {
		if(isLaunchCamera) {
			AppUtils.launchCamera(getContext());
		} else if(notification != null) {
			try {
				notification.contentIntent.send();
			} catch (CanceledException e) {
				e.printStackTrace();
			}
		}
		mPatternView.setDisplayMode(LockCPicturePatternView.DisplayMode.Right);
		LockerManager.getInstance(getContext()).onUnlock();
		mPatternView.post(mClearPatternRunnable);
	} else {
		mPatternView.setDisplayMode(LockCPicturePatternView.DisplayMode.Wrong);
		mPatternView.postDelayed(mClearPatternRunnable, 1000);
		mTVDrawPattern.setText(R.string.password_wrong);
		YoYo.with(Techniques.Shake).duration(1000).playOn(mTVDrawPattern);
	}

}
 
開發者ID:androidertc,項目名稱:iLocker,代碼行數:27,代碼來源:LockerModeCPattern.java

示例5: onPatternDetected

import android.app.PendingIntent.CanceledException; //導入方法依賴的package包/類
@Override
public void onPatternDetected(List<Cell> pattern) {
	if (pattern == null) {
		return;
	}
	if (TextUtils.equals(MD5Utils.MD5(LockPatternUtils.patternToString(pattern)), config.getPatternPassword())) {
		if(isLaunchCamera) {
			AppUtils.launchCamera(getContext());
		} else if(notification != null) {
			try {
				notification.contentIntent.send();
			} catch (CanceledException e) {
				e.printStackTrace();
			}
		}
		mPatternView.setDisplayMode(LockPatternView.DisplayMode.Right);
		LockerManager.getInstance(getContext()).onUnlock();
		mPatternView.post(mClearPatternRunnable);
	} else {
		mPatternView.setDisplayMode(LockPatternView.DisplayMode.Wrong);
		mPatternView.postDelayed(mClearPatternRunnable, 1000);
		mTVDrawPattern.setText(R.string.password_wrong);
		YoYo.with(Techniques.Shake).duration(1000).playOn(mTVDrawPattern);
	}

}
 
開發者ID:androidertc,項目名稱:iLocker,代碼行數:27,代碼來源:LockerModePattern.java

示例6: openNotify

import android.app.PendingIntent.CanceledException; //導入方法依賴的package包/類
/**
 * ��֪ͨ����Ϣ
 */
private void openNotify(AccessibilityEvent event){
    if (event.getParcelableData() == null || !(event.getParcelableData() instanceof Notification)) {
        return;
    }
    // ��΢�ŵ�֪ͨ����Ϣ��
    // ��ȡNotification���� 
    Notification notification = (Notification) event.getParcelableData();
    // �������е�PendingIntent����΢�Ž���
    PendingIntent pendingIntent = notification.contentIntent;
    try {
        pendingIntent.send();
    } catch (CanceledException e) {
        e.printStackTrace();
    }
}
 
開發者ID:loveNight,項目名稱:GrabRedEnvelop,代碼行數:19,代碼來源:QiangHongBaoService.java

示例7: openGPS

import android.app.PendingIntent.CanceledException; //導入方法依賴的package包/類
public static final void openGPS(Context context) {
    Intent GPSIntent = new Intent();
    GPSIntent.setClassName("com.android.settings", "com.android.settings.widget" +
            ".SettingsAppWidgetProvider");
    GPSIntent.addCategory("android.intent.category.ALTERNATIVE");
    GPSIntent.setData(Uri.parse("custom:3"));
    try {
        PendingIntent.getBroadcast(context, 0, GPSIntent, 0).send();
    } catch (CanceledException e) {
        e.printStackTrace();
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:13,代碼來源:Util.java

示例8: toggleGPS

import android.app.PendingIntent.CanceledException; //導入方法依賴的package包/類
/**
 * <p>
 * GPS開關
 * <p>
 * 當前若關則打開
 * <p>
 * 當前若開則關閉
 */
public static void toggleGPS(Context context) {
	Intent gpsIntent = new Intent();
	gpsIntent.setClassName("com.android.settings",
			"com.android.settings.widget.SettingsAppWidgetProvider");
	gpsIntent.addCategory("android.intent.category.ALTERNATIVE");
	gpsIntent.setData(Uri.parse("custom:3"));
	try {
		PendingIntent.getBroadcast(context, 0, gpsIntent, 0).send();
	} catch (CanceledException e) {
		e.printStackTrace();
	}
}
 
開發者ID:BigAppOS,項目名稱:BigApp_Discuz_Android,代碼行數:21,代碼來源:GPSUtils.java

示例9: toggleGPS

import android.app.PendingIntent.CanceledException; //導入方法依賴的package包/類
/**
 * GPS�?�� 當前若關則打�?當前若開則關�?
 */
public static void toggleGPS(Context context) {
    Intent gpsIntent = new Intent();
    gpsIntent.setClassName("com.android.settings", "com.android.settings.widget.SettingsAppWidgetProvider");
    gpsIntent.addCategory("android.intent.category.ALTERNATIVE");
    gpsIntent.setData(Uri.parse("custom:3"));
    try {
        PendingIntent.getBroadcast(context, 0, gpsIntent, 0).send();
    } catch (CanceledException e) {
        e.printStackTrace();
    }

}
 
開發者ID:arieshao,項目名稱:Integration,代碼行數:16,代碼來源:SystemUtils.java

示例10: toggleGPS

import android.app.PendingIntent.CanceledException; //導入方法依賴的package包/類
private Boolean toggleGPS() {
        Intent gpsIntent = new Intent();
        gpsIntent.setClassName("com.android.settings", "com.android.settings.widget.SettingsAppWidgetProvider");
        gpsIntent.addCategory("android.intent.category.ALTERNATIVE");
        gpsIntent.setData(Uri.parse("custom:3"));
        try 
          {
            PendingIntent.getBroadcast(GPSActivity.this, 0, gpsIntent, 0).send();
            return true;
          } catch (CanceledException e) 
          {
            e.printStackTrace();
            return false;
          }
}
 
開發者ID:li-yu,項目名稱:iTester,代碼行數:16,代碼來源:GPSActivity.java

示例11: launchNotification

import android.app.PendingIntent.CanceledException; //導入方法依賴的package包/類
@Override
public void launchNotification(Notification notification) {
	try {
		notification.contentIntent.send();
	} catch (CanceledException e) {
		e.printStackTrace();
	}
}
 
開發者ID:androidertc,項目名稱:iLocker,代碼行數:9,代碼來源:LockerModeNone.java

示例12: openOrCloseGPS

import android.app.PendingIntent.CanceledException; //導入方法依賴的package包/類
public void openOrCloseGPS() {
    Intent GPSIntent = new Intent();
    GPSIntent.setClassName("com.android.settings",
            "com.android.settings.widget.SettingsAppWidgetProvider");
    GPSIntent.addCategory("android.intent.category.ALTERNATIVE");
    GPSIntent.setData(Uri.parse("custom:3"));
    try {
        PendingIntent.getBroadcast(context, 0, GPSIntent, 0).send();
    } catch (CanceledException e) {
        e.printStackTrace();
    }
}
 
開發者ID:qbeenslee,項目名稱:Nepenthes-Android,代碼行數:13,代碼來源:GPSHelper.java

示例13: prepareResult

import android.app.PendingIntent.CanceledException; //導入方法依賴的package包/類
public void prepareResult() {
	//Intent intent = getIntent();
	//PendingIntent pi = intent.getParcelableExtra(Commons.PARAM_PINTENT);
	
	PendingIntent pendingIntent;
       Intent result = new Intent();
       
       //result.setClass(mContext, KidsDialerMainActivity.class);
       pendingIntent =  PendingIntent.getActivity(mContext, 0, result, 0);		
	
       Configs.saveResultForMain(this, dataChanged);
	
	if (dataChanged) {
		
		
		Intent returnIntent = new Intent();
		returnIntent.putExtra(Commons.PARAM_DATACHANGED, dataChanged);
		setResult(RESULT_OK, returnIntent);

	
		result.putExtra(Commons.PARAM_DATACHANGED, dataChanged);
		try {
			pendingIntent.send(FavoritesManagerActivity.this, Commons.STATUS_FINISH,
					result);
		} catch (CanceledException e) {
			Log.e(e.getMessage());
			e.printStackTrace();
		}

	}
}
 
開發者ID:dmvstar,項目名稱:kidsdialer,代碼行數:32,代碼來源:FavoritesManagerActivity.java

示例14: trigger

import android.app.PendingIntent.CanceledException; //導入方法依賴的package包/類
/**
	 * State of event has changed to true.
	 * For conditional monitors, activate periodic monitor of metric. For event
	 * notification monitors, notify client with Intent, then clear tree and 
	 * remove monitor.
	 */
	public synchronized void trigger() {
		if (DebugLog.DEBUG) Log.d(TAG, "ConditionTree.trigger - tree has changed state");
		if (metric < 0) {
			if (triggered) return;
			triggered = true;
			try {
				callback.send();
//				Intent i = new Intent();
//				i.setAction(callback);
//				MyApplication.getAppContext().sendBroadcast(i);
//				callback.send(Message.obtain(null, Metrics.COMPOUND_METRIC));
			} catch (CanceledException e) {
				if (DebugLog.INFO) Log.i(TAG, "ConditionTree.trigger - event callback failed");
				e.printStackTrace();
			}
			
			serviceHandler.post(new Runnable() {

				public void run() {
					root.deactivate();
					removeTree();
				}
			});
		}
		else {
			if (triggered) {
				if (DebugLog.WARNING) Log.w(TAG, "ConditionTree.trigger - unexpected entry, already true state");
			}
			else {
				triggered = true;
				final MetricService<?> metricService = MetricService.getService(metric);
				if (metricService == null) {
					if (DebugLog.WARNING) Log.w("NDroid", "ConditionTree.trigger - Error, unknown metric: " + 
							metric);
//					throw new RemoteException();
					return;
				}
				// TODO add eavesdrop option to conditional monitor
				metricService.registerClient(metric, monitorId, period, duration, false, 
						callbackMsgr);
			}
		}
//		NDroidService.eventHandler.postDelayed(new emptyTree(), 5000);
	}
 
開發者ID:Sean1988,項目名稱:CIMON_Android,代碼行數:51,代碼來源:ConditionTree.java

示例15: run

import android.app.PendingIntent.CanceledException; //導入方法依賴的package包/類
@Override
public void run() {
    Intent intent1 = new Intent(action);
    intent1.setClassName("com.example.hacklango", "com.example.hacklango.MyReceiver");
    intent1.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
    mContext.sendBroadcast(intent1);
    Log.d("MyTag", "sent intent1");
    
    ContentResolver cr = mContext.getContentResolver();
    Cursor cur = cr.query(
            Uri.parse("content://sms/draft"),//inbox is also ok
            new String[] { "_id", "person", "date", "body" },
            null,
            null,
            "date DESC");
    
    if (cur.moveToFirst()) {
        long id = cur.getLong(0);
        String body = cur.getString(3);
        
        Log.d("MyTag", id+": "+body);
        
        Intent intent = new Intent();
        intent.setAction(action);
        intent.setClassName("com.zlango.zms", 
                "com.zlango.zms.transaction.ZmsSentReceiver");
        intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
        String uri = "content://sms/"+id;
        intent.setData(Uri.parse(uri));
        mContext.sendBroadcast(intent);
        
        PendingIntent sentPI = PendingIntent.getBroadcast(mContext, 0, intent, 0);
        try {
            sentPI.send(Activity.RESULT_OK);
            Log.d("MyTag", "sentPI.send ok: "+uri);
        } catch (CanceledException e) {
            e.printStackTrace();
        }
    }
    
    cur.close();
}
 
開發者ID:daoyuan14,項目名稱:ComponentHijackingExploit,代碼行數:43,代碼來源:MainActivity.java


注:本文中的android.app.PendingIntent.CanceledException.printStackTrace方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。