Back to project page DtuExamTools.
The source code is released under:
RECEX SHARED SOURCE LICENSE version 1.0, 30 May 2013 Copyright (c) 2013 RecEx. <http://recex.co.in> Everyone is permitted to copy and distribute verbatim copies of this license docum...
If you think the Android project DtuExamTools listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/********************************************************************** RecEX DTU Exam Tools//from w w w .j a va2s.c o m Copyright (C) 2013 RecEx The source code of this program is shared under the RECEX SHARED SOURCE LICENSE (version 1.0). The source code is shared for referrence and academic purposes with the hope that people can read and learn from it. This is not Free and Open Source software, and code is not redistributable without permission of the author. Read the RECEX SHARED SOURCE LICENSE for details The source codes does not come with any warranty including the implied warranty of merchandise. You should have received a copy of the RECEX SHARED SOURCE LICENSE in the form of a License.txt file in the root of the source directory. If not, please refer to <https://raw.github.com/Recex/Licenses/master/SharedSourceLicense/LICENSE.txt> **********************************************************************/ package com.RecEx.dtuexamtools; import java.util.ArrayList; import com.google.analytics.tracking.android.EasyTracker; import com.google.analytics.tracking.android.GoogleAnalytics; import com.google.analytics.tracking.android.Tracker; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.GridView; import android.widget.Toast; public class Subjects extends Activity implements OnClickListener { private ArrayList<Button> mButtons = new ArrayList<Button>(); String group; private Tracker mGaTracker; private GoogleAnalytics mGaInstance; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mGaInstance = GoogleAnalytics.getInstance(this); mGaTracker = mGaInstance.getTracker("UA-40877184-1"); // Placeholder tracking ID. Bundle extras = getIntent().getExtras(); if (extras != null) { group = extras.getString("Group"); } if(group.equals("Group A")){ createButton("AP"); createButton("AM"); createButton("AC"); createButton("HU"); createButton("IT"); createButton("IT lab"); createButton("EE"); } if(group.equals("Group B")){ createButton("AP"); createButton("AM"); createButton("AP/AC"); createButton("ENE"); createButton("COE"); createButton("BME"); createButton("BME lab"); } GridView gridView = (GridView) findViewById(R.id.gridview); gridView.setAdapter(new CustomAdapter(mButtons)); } private void createButton(String string) { // TODO Auto-generated method stub Button cb = null; cb = new Button(this); cb.setText(string); cb.setBackgroundResource(R.drawable.fancy_button_selector); cb.setOnClickListener(this); registerForContextMenu(cb); mButtons.add(cb); } @Override public void onClick(View v) { Button selection = (Button)v; Toast.makeText(getBaseContext(), selection.getText()+ " was pressed!", Toast.LENGTH_SHORT).show(); Intent i = new Intent(getApplicationContext(), NotesAndBooks.class); i.putExtra("Subject",selection.getText()); startActivity(i); } @Override public void onStart() { super.onStart(); // The rest of your onStart() code. EasyTracker.getInstance().activityStart(this); // Add this method. } @Override public void onStop() { super.onStop(); // The rest of your onStop() code. EasyTracker.getInstance().activityStop(this); // Add this method. } }