Android Open Source - iwannawatch-android Main Activity






From Project

Back to project page iwannawatch-android.

License

The source code is released under:

MIT License

If you think the Android project iwannawatch-android 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.meoyawn.iwannawatch;
//from w  ww . j  a  va  2s. c o m
import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.MenuItem;

import com.google.analytics.tracking.android.EasyTracker;

public class MainActivity extends ActionBarActivity {
    @Override protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (savedInstanceState == null) {
            getSupportFragmentManager().beginTransaction()
                    .add(android.R.id.content, new MainFragmentBuilder(false).build())
                    .commit();
        }
    }

    @Override public boolean onOptionsItemSelected(MenuItem item) {
        try {
            switch (item.getItemId()) {
                case R.id.action_support:
                    Intent intent = new Intent(Intent.ACTION_SEND);
                    intent.setType("text/plain");
                    intent.putExtra(Intent.EXTRA_EMAIL, new String[]{"stiggpwnz@gmail.com"});
                    intent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.support, getString(R.string.app_name)));
                    startActivity(Intent.createChooser(intent, getString(R.string.send)));
                    return true;
                case R.id.action_store:
                    Uri uri = Uri.parse("https://play.google.com/store/apps/details?id=" + getPackageName());
                    startActivity(new Intent(Intent.ACTION_VIEW, uri));
                    return true;
            }
        } catch (ActivityNotFoundException ignored) {
        }
        return super.onOptionsItemSelected(item);
    }

    @Override protected void onStart() {
        super.onStart();
        EasyTracker.getInstance(this).activityStart(this);  // Add this method.
    }

    @Override protected void onStop() {
        super.onStop();
        EasyTracker.getInstance(this).activityStop(this);  // Add this method.
    }
}




Java Source Code List

com.meoyawn.iwannawatch.AppModule.java
com.meoyawn.iwannawatch.App.java
com.meoyawn.iwannawatch.CrashReportingTree.java
com.meoyawn.iwannawatch.DynamicHeightImageView.java
com.meoyawn.iwannawatch.MainActivity.java
com.meoyawn.iwannawatch.MainFragment.java
com.meoyawn.iwannawatch.MovieView.java
com.meoyawn.iwannawatch.adapters.BaseMoviesAdapter.java
com.meoyawn.iwannawatch.adapters.CursorMoviesAdapter.java
com.meoyawn.iwannawatch.adapters.DynamicMoviesAdapter.java
com.meoyawn.iwannawatch.doers.DatabaseHelper.java
com.meoyawn.iwannawatch.doers.TheMovieDbApi.java
com.meoyawn.iwannawatch.models.Movie.java
com.meoyawn.iwannawatch.models.Search.java
com.meoyawn.iwannawatch.qualifiers.Delete.java
com.meoyawn.iwannawatch.qualifiers.Done.java