Android Open Source - SSPIA Main Fragment

From Project

Back to project page SSPIA.


The source code is released under:

MIT License

If you think the Android project SSPIA 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.fiec.sspia.mclass;
//ww w .  j a  v a  2  s  .  c  o  m
import com.fiec.ssapp.R;
import com.fiec.sspia.buff.Tag;
import com.fiec.sspia.db.Planets;
import com.fiec.sspia.main.TabsPlanets;

import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

public class MainFragment extends Fragment{
  private ImageView planetimage;
  private FragmentActivity act;
  public String pname;
  public int position;
  private TabsPlanets tp;
  private Planets planet;
  private String[] tags;
  public void onActivityCreated(Bundle savedInstanceState) {
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
      Bundle saved) {
    View view = inflater.inflate(R.layout.activity_planets, null);
    this.planetimage = (ImageView)view.findViewById(;  
    /*if(saved != null){
      Log.i(Tag._TAG, "saved no nulo");
      this.tags = saved.getStringArray("tagskey");
      this.position = saved.getInt("poskey");
      Log.w(Tag._TAG,"pname no nulo "+planet.getName());
      Log.w(Tag._TAG,"pos "+position);
      Log.w(Tag._TAG,"inf "+planet.getinf()[0]);
    tp = new TabsPlanets(act, this, view, planet, position, tags);
    return view;
  public void onSaveInstanceState(Bundle out) {
    out.putParcelable("planetkey", planet);
    out.putStringArray("tagskey", this.tags);
    out.putInt("poskey", position);
  public void setact(FragmentActivity act){
    this.act = act;
  public void setPosition(int pos){
    this.position = pos;
  public void setPlanet(Planets planet, String[] tags){
    this.planet = planet;
    this.tags = tags;
  public void onDestroyView() {
    tp = null;

Java Source Code List