Android Open Source - UniApp Main Activity






From Project

Back to project page UniApp.

License

The source code is released under:

MIT License

If you think the Android project UniApp 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 it.nic.uniapp;
/*from w w w  .j  a  va2  s . c  o  m*/
import it.nic.uniapp.core.PageLoader;
import it.nic.uniapp.core.PageLoader.PageType;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.TextView;

public class MainActivity extends Activity {
  
  private PageLoader pageLoader = null;
  
  private TextView txtBenvenuto = null;
  private ImageView imageView1 = null;
  private ImageButton btnCalendar = null;
  private Button btnRes = null;
  private Button btnAllEsami = null;


  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    
    this.pageLoader = new PageLoader();
    
    this.txtBenvenuto = (TextView)this.findViewById(R.id.activity_main__txtBENVENUTO);
    this.imageView1 = (ImageView)this.findViewById(R.id.activity_main__imageView1);
    this.btnCalendar = (ImageButton)this.findViewById(R.id.activity_main__btnCALENDAR);
    this.btnAllEsami = (Button)this.findViewById(R.id.activity_main__btnAllEsami);
    this.btnRes = (Button)this.findViewById(R.id.activity_main__btnRES);
    
    this.btnCalendar.setOnClickListener(btn_OnClickListener);
    this.btnRes.setOnClickListener(btn_OnClickListener);
    this.btnAllEsami.setOnClickListener(btn_OnClickListener);
    
  }
  
  private void OnClick(View view) {
    String tag = view.getTag() != null ? (String) view.getTag() : null;

    if (tag != null && tag.equals("activity_main__btnCALENDAR")) {
      pageLoader.startPageDependentActivity(this, PageType.CalendarioEsami,false, null);
    }
    
    else if (tag != null && tag.equals("activity_main__btnAllEsami")){
      pageLoader.startPageDependentActivity(this, PageType.ListaEsami,false, null);
    }
    
    else if (tag != null && tag.equals("activity_main__btnRES")){
      pageLoader.startPageDependentActivity(this, PageType.FunzioniEsami,false, null);
    }
  }

  private OnClickListener btn_OnClickListener = new OnClickListener() {
    public void onClick(View view) {
      OnClick(view);
    }

  };

  @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;
  }

}




Java Source Code List

it.nic.uniapp.AddEsame.java
it.nic.uniapp.CalendarioEsami.java
it.nic.uniapp.FunzioniEsami.java
it.nic.uniapp.ListaEsami.java
it.nic.uniapp.MainActivity.java
it.nic.uniapp.PopUpWindow.java
it.nic.uniapp.UpdateEsame.java
it.nic.uniapp.adapters.EsameAdapter.java
it.nic.uniapp.adapters.GridCellAdapter.java
it.nic.uniapp.cmp.EsameRowControl.java
it.nic.uniapp.core.Constants.java
it.nic.uniapp.core.PageLoader.java
it.nic.uniapp.db.DBHandler.java
it.nic.uniapp.db.DatabaseConfigUtil.java
it.nic.uniapp.db.DatabaseHelper.java
it.nic.uniapp.db.EsameEntity.java
it.nic.uniapp.db.IDBHandler.java
it.nic.uniapp.util.Util.java