Code example for PackageManager

Methods: getLaunchIntentForPackage

0
	 * @param activity 
	 *            {@link Activity}. 
	 */ 
	public static void collectAndSendLog(final Activity activity) {
		final PackageManager packageManager = activity.getPackageManager();
		Intent intent = packageManager
				.getLaunchIntentForPackage(SENDLOG_PACKAGE_NAME);
		final String pkg = activity.getPackageName();
		int title, message;
		if (intent == null) {
			intent = new Intent(
					Intent.ACTION_VIEW,
					Uri.parse("market://search?q=pname:" + SENDLOG_PACKAGE_NAME));
			title = activity.getResources().getIdentifier("sendlog_install_",
					"string", pkg);
			message = activity.getResources().getIdentifier("sendlog_install",
					"string", pkg);
		} else { 
			intent.putExtra("filter", TAG + ":D *:W");
			intent.setType("0||android@ub0r.de");
			title = activity.getResources().getIdentifier("sendlog_run_",