/** * code from the book Arduino + ANdroid Projects for the Evil Genius * <br>Copyright 2011 Simon Monk * * <p>This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation (see COPYING). * * <p>This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ package org.simonmonk.geiger; import android.app.Activity; import android.content.ActivityNotFoundException; import android.content.Intent; import android.os.Bundle; import android.util.Log; public class DroidGeigerLaunch extends Activity { static final String TAG = "DroidGeigerLaunch"; static Intent createIntent(Activity activity) { return new Intent(activity, DroidGeiger.class); } @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Intent intent = createIntent(this); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); try { startActivity(intent); } catch (ActivityNotFoundException e) { Log.e(TAG, "unable to start DroidGeiger activity", e); } finish(); } }