Android Open Source - oec_android Main Activity






From Project

Back to project page oec_android.

License

The source code is released under:

MIT License

If you think the Android project oec_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.biekerwebdesign.openexoplanetcatalogue;
//from w w  w .jav a2  s  . c  o  m
import android.app.Activity;
import android.app.FragmentTransaction;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.media.audiofx.BassBoost;
import android.os.AsyncTask;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.Menu;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.view.Menu;
import android.view.MenuItem;


import java.util.List;
import java.util.ArrayList;

import com.biekerwebdesign.beans.System;
import com.biekerwebdesign.settings.SettingsActivity;
import com.biekerwebdesign.xml.XMLPullParserSystem;
import android.util.Log;

import java.io.IOException;
import org.xmlpull.v1.XmlPullParserException;

public class MainActivity extends Activity {

    private ListView listView;
    private XMLPullParserSystem parser;
    private List<System> systems;
    private ArrayAdapter<System> adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        PreferenceManager.setDefaultValues(this, R.xml.preferences, false);

        if (findViewById(R.id.first_container) != null && findViewById(R.id.second_container) != null) {
            if (savedInstanceState == null) {
                FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
                fragmentTransaction.add(R.id.first_container, new SystemFragment());
                fragmentTransaction.add(R.id.second_container, new StarFragment());
                fragmentTransaction.commit();
            }
        } else if (findViewById(R.id.first_container) != null) {
            if (savedInstanceState == null) {
                FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
                fragmentTransaction.add(R.id.first_container, new SystemFragment());
                fragmentTransaction.commit();
            }

        }
    }

    public void openSettings() {

    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.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();
        if (id == R.id.action_settings) {
            Intent intent = new Intent(this, SettingsActivity.class);
            startActivity(intent);
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

}




Java Source Code List

com.biekerwebdesign.beans.Planet.java
com.biekerwebdesign.beans.Star.java
com.biekerwebdesign.beans.System.java
com.biekerwebdesign.openexoplanetcatalogue.MainActivity.java
com.biekerwebdesign.openexoplanetcatalogue.PlanetActivity.java
com.biekerwebdesign.openexoplanetcatalogue.PlanetFragment.java
com.biekerwebdesign.openexoplanetcatalogue.StarActivity.java
com.biekerwebdesign.openexoplanetcatalogue.StarFragment.java
com.biekerwebdesign.openexoplanetcatalogue.SystemActivity.java
com.biekerwebdesign.openexoplanetcatalogue.SystemFragment.java
com.biekerwebdesign.settings.SettingsActivity.java
com.biekerwebdesign.settings.SettingsFragment.java
com.biekerwebdesign.xml.XMLPullParserPlanet.java
com.biekerwebdesign.xml.XMLPullParserStar.java
com.biekerwebdesign.xml.XMLPullParserSystem.java