Android Open Source - Music-Theory Home Activity






From Project

Back to project page Music-Theory.

License

The source code is released under:

GNU General Public License

If you think the Android project Music-Theory 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.mt;
/*  w w w .  j av a  2  s.c o m*/
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.Window;
import android.widget.TabHost;

import com.mt.keys.KeySignatureQuizPreferenceActivity;
import com.mt.notes.NoteQuizPreferenceActivity;

public class HomeActivity extends TabActivity {

  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_NO_TITLE);

    setContentView(R.layout.home_layout);

    Resources res = getResources(); // Resource object to get Drawables
    TabHost tabHost = getTabHost(); // The activity TabHost
    TabHost.TabSpec spec; // Resusable TabSpec for each tab
    Intent intent; // Reusable Intent for each tab

    intent = new Intent().setClass(this, NoteQuizPreferenceActivity.class);
    // Initialize a TabSpec for each tab and add it to the TabHost
    spec = tabHost.newTabSpec("noteIdentificationConfig")
      .setIndicator("Notes", res.getDrawable(R.drawable.ic_tab_notes))
      .setContent(intent);
    tabHost.addTab(spec);

    // Do the same for the other tabs
    intent = new Intent().setClass(this, KeySignatureQuizPreferenceActivity.class);
    spec = tabHost.newTabSpec("keyIdentificationConfig")
      .setIndicator("Keys", res.getDrawable(R.drawable.ic_tab_keys))
      .setContent(intent);
    tabHost.addTab(spec);

    tabHost.setCurrentTab(0);

  }

}




Java Source Code List

com.mt.HomeActivity.java
com.mt.QuizActivity.java
com.mt.audio.MidiTrack.java
com.mt.keys.KeySignatureQuizActivity.java
com.mt.keys.KeySignatureQuizPreferenceActivity.java
com.mt.notes.NoteQuizActivity.java
com.mt.notes.NoteQuizPreferenceActivity.java
com.mt.staff.ScoreView.java
com.mt.theory.Accidental.java
com.mt.theory.Clef.java
com.mt.theory.Duration.java
com.mt.theory.Interval.java
com.mt.theory.KeySignature.java
com.mt.theory.NoteGroup.java
com.mt.theory.Note.java
com.mt.theory.Quality.java
com.mt.theory.Score.java
com.mt.theory.TimeSignature.java
com.mt.theory.Tone.java
com.mt.utils.NoteUtil.java
com.mt.utils.QuizUtil.java