Android Open Source - pokedex Pokemon Detail






From Project

Back to project page pokedex.

License

The source code is released under:

MIT License

If you think the Android project pokedex 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.andrescanales.pokedex;
//from ww  w.jav a2 s  . c  om
import android.content.res.Configuration;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;

public class PokemonDetail extends ActionBarActivity {

    private Pokemon mpokemon;

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

        if (getSupportActionBar() != null) {
            getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        }

        if (savedInstanceState != null) {
            mpokemon = savedInstanceState.getParcelable("pokemon");
        } else {
            Pokemon pokemon = getIntent().getParcelableExtra("pokemon");
            mpokemon = pokemon;
            Pokemon avatar = getIntent().getParcelableExtra("avatar");
        }

        PokemonDetailFragment fragment = PokemonDetailFragment.newInstance(mpokemon);
        getSupportFragmentManager().beginTransaction()
                .replace(R.id.pokemon_detail_container, fragment).commit();
    }


    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putParcelable("pokemon", mpokemon);
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
    }

}




Java Source Code List

com.andrescanales.pokedex.ApplicationTest.java
com.andrescanales.pokedex.GsonRequest.java
com.andrescanales.pokedex.MainActivity.java
com.andrescanales.pokedex.PokedexApplication.java
com.andrescanales.pokedex.PokemonAdapter.java
com.andrescanales.pokedex.PokemonDetailFragment.java
com.andrescanales.pokedex.PokemonDetail.java
com.andrescanales.pokedex.PokemonListApiTask.java
com.andrescanales.pokedex.PokemonListFragment.java
com.andrescanales.pokedex.Pokemon.java
com.andrescanales.pokedex.SettingsActivity.java