Beispiel #1
0
  /**
   * everything is start from here.
   *
   * @see android.support.v4.app.FragmentActivity#onCreate(android.os.Bundle)
   */
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    hasChanges = false;
    // === Inflate the layout
    setContentView(R.layout.label_layout);
    getActionBar().setDisplayHomeAsUpEnabled(true);
    // === Initialise the TabHost
    this.initialiseTabHost(savedInstanceState);
    if (savedInstanceState != null) {
      // set the tab as per the saved state
      mTabHost.setCurrentTabByTag(savedInstanceState.getString("tab"));
    }
    // === find the label =====
    final int node_index = getIntent().getExtras().getInt("node_index", -99999);
    // === Initialise ViewPager
    final RouteNode n = current_sketch_map.get_route_node_at(node_index);
    intializeViewPager(n);
    intializeOtherInfo(n);
    onCreateSpinner();
    addNumbericPicker();
    label_display_field = (TextView) findViewById(R.id.label_display);
    display_label_but = (Button) findViewById(R.id.label_display_control_button);
    display_label_but.setOnClickListener(this);

    if (node_index > -1) {
      addLineFactory(node_index);
      // display_loaded_data(node_index);
    } else {
      Tool.trace(this, "Error there is no data to display in here");
    }
  }
Beispiel #2
0
 public void onRestoreInstanceState(Bundle savedInstanceState) {
   // Always call the superclass so it can restore the view hierarchy
   super.onRestoreInstanceState(savedInstanceState);
   // Restore state members from saved instance
 }
Beispiel #3
0
 /**
  * (non-Javadoc)
  *
  * @see android.support.v4.app.FragmentActivity#onSaveInstanceState(android.os.Bundle)
  */
 @Override
 protected void onSaveInstanceState(Bundle outState) {
   outState.putString("tab", mTabHost.getCurrentTabTag()); // save the tab selected
   super.onSaveInstanceState(outState);
 }