Android Open Source - ApplicationSessionActivity Main Example Activity Application






From Project

Back to project page ApplicationSessionActivity.

License

The source code is released under:

Copyright (C) 2012 Apptentive Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the So...

If you think the Android project ApplicationSessionActivity listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.apptentive.android.example;
//from   w w  w .ja va  2  s .  c  o m
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import com.apptentive.android.application.ApplicationSessionActivity;

public class MainExampleActivityApplication extends ApplicationSessionActivity {

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

    // Pass a listener in so we can be notified of session starts.
    setOnSessionStartedListener(new SessionStartedListener() {
      public void onSessionStarted() {
        Log.e("ApplicationSessionExample", "Starting session.");
      }
    });

    // Pass a listener in so we can be notified of session stops.
    setOnSessionStoppedListener(new SessionStoppedListener() {
      public void onSessionStopped() {
        Log.e("ApplicationSessionExample", "Stopping session.");
      }
    });
  }

  /**
   * Referenced from main.xml
   * @param view
   */
  public void launchChildActivity(View view) {
    Intent intent = new Intent();
    intent.setClass(this, ChildExampleActivityApplication.class);
    startActivity(intent);
  }
}




Java Source Code List

com.apptentive.android.application.ApplicationSessionActivity.java
com.apptentive.android.example.ChildExampleActivityApplication.java
com.apptentive.android.example.MainExampleActivityApplication.java