Android Open Source - MateLightAndroid Main Activity






From Project

Back to project page MateLightAndroid.

License

The source code is released under:

Apache License

If you think the Android project MateLightAndroid 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 de.cketti.matelight;
//from  w  ww . ja va 2  s .c o m
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;

public class MainActivity extends Activity {

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

        if (savedInstanceState == null) {
            getFragmentManager().beginTransaction()
                    .add(R.id.container, new MateLightFragment())
                    .commit();
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        int id = item.getItemId();
        if (id == R.id.action_about) {
            new AboutFragment().show(getFragmentManager(), "about");
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

}




Java Source Code List

de.cketti.matelight.AboutFragment.java
de.cketti.matelight.MainActivity.java
de.cketti.matelight.MateLightFragment.java
de.cketti.matelight.MateLight.java