/*
 * Copyright (c) 2014, Apptentive, Inc. All Rights Reserved.
 * Please refer to the LICENSE file for the terms and conditions
 * under which redistribution and use of this file is permitted.
 */

package com.apptentive.android.example;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import com.apptentive.android.sdk.Apptentive;

/**
 * This is an example integration of Apptentive.
 *
 * @author Sky Kelsey
 */
public class ExampleActivity extends Activity {

	private static String LOG_TAG = "Apptentive Example";

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
	}

	@Override
	public void onWindowFocusChanged(boolean hasFocus) {
		super.onWindowFocusChanged(hasFocus);
		// Only engage if this window is gaining focus.
		if (hasFocus) {
			// If you plan on showing your own views, first make sure Apptentive hasn't already shown one.
			boolean apptentiveShowedInteraction = Apptentive.engage(this, "init");
		}
	}

	/**
	 * Provide a simple feedback button in your app.
	 */
	public void onMessageCenterButtonPressed(@SuppressWarnings("unused") View view) {
		Apptentive.showMessageCenter(this);
	}
}

@@ -685,16 +685,106 @@
 n);%0A%09%7D%0A%0A
+%09@Override%0A%09protected void onStart() %7B%0A%09%09super.onStart();%0A%09%09Apptentive.onStart(this);%0A%09%7D%0A%0A
 %09@Overri
@@ -1128,16 +1128,103 @@
 %09%09%7D%0A%09%7D%0A%0A
+%09@Override%0A%09protected void onStop() %7B%0A%09%09super.onStop();%0A%09%09Apptentive.onStop(this);%0A%09%7D%0A%0A
 %09/**%0A%09 *

Use the Apptentive Activity Delegation mechanism