Android Open Source - SOIAF_RPG Character Activity






From Project

Back to project page SOIAF_RPG.

License

The source code is released under:

GNU General Public License

If you think the Android project SOIAF_RPG 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 de.mroehrl.soiaf_rpg;
//w  w  w .j a v  a 2  s  .com
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.NavUtils;
import android.view.Menu;
import android.view.MenuItem;

public class CharacterActivity extends Activity {

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

        // Show the Up button in the action bar.
        getActionBar().setDisplayHomeAsUpEnabled(true);

        // savedInstanceState is non-null when there is fragment state
        // saved from previous configurations of this activity
        // (e.g. when rotating the screen from portrait to landscape).
        // In this case, the fragment will automatically be re-added
        // to its container so we don't need to manually add it.
        // For more information, see the Fragments API guide at:
        //
        // http://developer.android.com/guide/components/fragments.html
        //
        if (savedInstanceState == null) {
            // Create the detail fragment and add it to the activity
            // using a fragment transaction.
            
            CharacterFragment fragment = new CharacterFragment();
            
            getFragmentManager().beginTransaction()
                    .add(R.id.item_detail_container, fragment)
                    .commit();
        }      
  }

  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu; this adds items to the action bar if it is present.
    getMenuInflater().inflate(R.menu.character, menu);
    return true;
  }

  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here. The action bar will
    // automatically handle clicks on the Home/Up button, so long
    // as you specify a parent activity in AndroidManifest.xml.
          
    switch(item.getItemId()) {
      case android.R.id.home:
        NavUtils.navigateUpTo(this, new Intent(this, ItemListActivity.class));
        return true;              
    }
    
        return super.onOptionsItemSelected(item);
  }
  
}




Java Source Code List

de.mroehrl.RPG.RPGCharacter.java
de.mroehrl.RPG.SqlOpenHelper.java
de.mroehrl.soiaf_rpg.CharacterActivity.java
de.mroehrl.soiaf_rpg.CharacterFragment.java
de.mroehrl.soiaf_rpg.CurrencyActivity.java
de.mroehrl.soiaf_rpg.CurrencyFragment.java
de.mroehrl.soiaf_rpg.ItemListActivity.java
de.mroehrl.soiaf_rpg.ItemListFragment.java
de.mroehrl.soiaf_rpg.content.SOIAFContent.java