Android Open Source - lostpets Main Activity






From Project

Back to project page lostpets.

License

The source code is released under:

GNU General Public License

If you think the Android project lostpets 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 fr.esiea.mobile.lostpets.activity;
//from   w ww .  j a  va 2  s .  co m
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import fr.esiea.mobile.lostpets.R;

//This class is the MainActivity linked to activity_main.xml
public class MainActivity extends Activity implements View.OnClickListener {

    Button m_btnInfos;
    Button m_btnLostPet;
    Button m_btnFoundPet;
    Button m_btnLostPetAroundMe;

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

        m_btnLostPet = (Button) findViewById(R.id.btn_lostMyPet);
        m_btnLostPet.setOnClickListener(this);
        m_btnFoundPet = (Button) findViewById(R.id.btn_findPet);
        m_btnFoundPet.setOnClickListener(this);
        m_btnLostPetAroundMe = (Button) findViewById(R.id.btn_lostPetsAroundMe);
        m_btnLostPetAroundMe.setOnClickListener(this);
        m_btnInfos = (Button) findViewById(R.id.btn_infos);
        m_btnInfos.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        Intent nextActivity;
        if (R.id.btn_infos == view.getId()){
            nextActivity = new Intent(this, InfosActivity.class);
            startActivity(nextActivity);
        }
        else if (R.id.btn_findPet == view.getId()){
            nextActivity = new Intent(this, PetActivity.class);
            startActivity(nextActivity);
        }
        else if (R.id.btn_lostMyPet == view.getId()) {
            nextActivity = new Intent(this, CreateLostPetActivity.class);
            startActivity(nextActivity);
        }
        else if (R.id.btn_lostPetsAroundMe == view.getId()) {
            nextActivity = new Intent(this, MapsActivity.class);
            startActivity(nextActivity);
        }
    }
}




Java Source Code List

fr.esiea.mobile.lostpets.ApplicationTest.java
fr.esiea.mobile.lostpets.activity.CreateLostPetActivity.java
fr.esiea.mobile.lostpets.activity.InfosActivity.java
fr.esiea.mobile.lostpets.activity.MainActivity.java
fr.esiea.mobile.lostpets.activity.MapsActivity.java
fr.esiea.mobile.lostpets.activity.PetActivity.java
fr.esiea.mobile.lostpets.activity.PetMarkerActivity.java
fr.esiea.mobile.lostpets.activity.TakePictureActivity.java
fr.esiea.mobile.lostpets.adapter.PetAdapter.java
fr.esiea.mobile.lostpets.dao.UserDataSource.java
fr.esiea.mobile.lostpets.dao.WebServiceDAO.java
fr.esiea.mobile.lostpets.fragment.PetFragment.java
fr.esiea.mobile.lostpets.fragment.PetListFragment.java
fr.esiea.mobile.lostpets.model.Pet.java
fr.esiea.mobile.lostpets.model.Pets.java
fr.esiea.mobile.lostpets.model.User.java
fr.esiea.mobile.lostpets.sql.MySQLiteHelper.java
fr.esiea.mobile.lostpets.util.PictureFileManager.java