Android Open Source - demo-flickr-feed-android Main Activity






From Project

Back to project page demo-flickr-feed-android.

License

The source code is released under:

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...

If you think the Android project demo-flickr-feed-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 uk.org.tomek.flickrfeed.activity;
/*from www.java 2s . co  m*/
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.widget.Toolbar;
import android.view.Menu;
import android.view.MenuItem;

import uk.org.tomek.flickrfeed.R;
import uk.org.tomek.flickrfeed.fagment.StartingFragment;

/**
 * Main app activity.
 */
public class MainActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        if (toolbar != null) {
            setSupportActionBar(toolbar);
        }
        if (savedInstanceState == null) {
            getFragmentManager().beginTransaction()
                    .add(R.id.container, new StartingFragment(), StartingFragment.TAG)
                    .commit();
        }
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        // noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            startActivity(new Intent(this, SettingsActivity.class));
            return true;
        }

        return super.onOptionsItemSelected(item);
    }

}




Java Source Code List

tomek.co.uk.flickrfeed.ApplicationTest.java
uk.org.tomek.flickrfeed.App.java
uk.org.tomek.flickrfeed.activity.ImageDetailsActivity.java
uk.org.tomek.flickrfeed.activity.MainActivity.java
uk.org.tomek.flickrfeed.activity.SettingsActivity.java
uk.org.tomek.flickrfeed.adapter.FeedAdapter.java
uk.org.tomek.flickrfeed.fagment.SettingsFragment.java
uk.org.tomek.flickrfeed.fagment.StartingFragment.java
uk.org.tomek.flickrfeed.model.Feed.java
uk.org.tomek.flickrfeed.model.Item.java
uk.org.tomek.flickrfeed.model.Media.java
uk.org.tomek.flickrfeed.rest.FlickrConverter.java
uk.org.tomek.flickrfeed.rest.MockRestClient.java
uk.org.tomek.flickrfeed.rest.RealRestClient.java
uk.org.tomek.flickrfeed.rest.RestClient.java
uk.org.tomek.flickrfeed.rest.RestUtils.java
uk.org.tomek.flickrfeed.rest.service.FlickrPostsService.java
uk.org.tomek.flickrfeed.utils.Logger.java
uk.org.tomek.flickrfeed.utils.StringUtils.java