

@Override
protected void onSaveInstanceState(Bundle savedInstanceState) {
    super.onSaveInstanceState(savedInstanceState);
    savedInstanceState.putInt("current_tab_selected", mTabHost.getCurrentTab());
}

@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
  super.onRestoreInstanceState(savedInstanceState);
  int selectedTab = savedInstanceState.getInt("current_tab_selected");
  Log.d("Demo", selectedTab + "");
}

@Override
public void onCreate(Bundle savedInstanceState) {

   ...

    if(savedInstanceState!= null) {
        int selectedTabIndex = savedInstanceState.getInt("current_tab_selected");
        mTabHost.setCurrentTab(selectedTabIndex);
    }
}

Please help and thanks in advance.

A:

You can not get Data in onSaveInstanceState();
you need to use onRestoreInstanceState() instead of onSaveInstanceState();
Like this:
@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {

  super.onRestoreInstanceState(savedInstanceState);
  String str = savedInstanceState.getString("curTab");

}

Or you can also access this in Activity onCreate(), if Bundle object is contains curTab.
 @Override
    public void onCreate(Bundle savedInstanceState) {

      super.onCreate(savedInstanceState);

       if(savedInstanceState!= null)
          String str = savedInstanceState.getString("curTab");

    }

 Q:

Better representaion of natural numbers as sets?

Natural numbers can be represented as
$0=\emptyset$
$1=\{\emptyset\}$
$2=\{\{\emptyset\}\}$
$...$
or as
$0=\emptyset$
$1=\{0\}=0\cup\{0\}$
$2=\{0,1\}=1\cup\{1\}$
$...$
What are the names of these representations?
Aren't they identical?
What are advantages of second representation?

A:

These are respectively Zermelo's and von Neumann's representations/implementations of the naturals in set theory.
If you just want to reconstruct arithmetic and then classical analysis inside set theory, Zermelo's representation works just fine and some standard textbooks do things that way
@Override 
 protected void onSaveInstanceState(Bundle savedInstanceState) { 
     super.onSaveInstanceState(savedInstanceState); 
     savedInstanceState.putInt("current_tab_selected ", mTabHost.getCurrentTab ()); 
 } 

 @Override 
 public void onRestoreInstanceState(Bundle savedInstanceState) { 
   super.onRestoreInstanceState(savedInstanceState); 
   int selectedTab = savedInstanceState.getInt("current_tab_selected "); 
   Log.d("Demo ", selectedTab + " "); 
 } 

 @Override 
 public void onCreate(Bundle savedInstanceState) { 

   ... 

     if(savedInstanceState!= null) { 
         int selectedTabIndex = savedInstanceState.getInt("current_tab_selected "); 
         mTabHost.setCurrentTab(selectedTabIndex); 
     } 
 } 

 Please avail and thanks in overture. 

 A: 

 You cannot get Data in onSaveInstanceState (); 
 you need to practice onRestoreInstanceState () instead of onSaveInstanceState (); 
 Like this: 
 @Override 
 public void onRestoreInstanceState(Bundle savedInstanceState) { 

   super.onRestoreInstanceState(savedInstanceState); 
   String str = savedInstanceState.getString("curTab "); 

 } 

 Or you can also access this in Activity onCreate (), if Bundle aim is contain curTab. 
  @Override 
     public void onCreate(Bundle savedInstanceState) { 

       super.onCreate(savedInstanceState); 

        if(savedInstanceState!= null) 
           String str = savedInstanceState.getString("curTab "); 

     } 

  Q: 

 good representaion of natural numbers as set? 

 Natural numbers can be represented as 
 $ 0=\emptyset$ 
 $ 1=\{\emptyset\}$ 
 $ 2=\{\{\emptyset\}\}$ 
 $... $ 
 or equally 
 $ 0=\emptyset$ 
 $ 1=\{0\}=0\cup\{0\}$ 
 $ 2=\{0,1\}=1\cup\{1\}$ 
 $... $ 
 What are the names of these representations? 
 Aren't they identical? 
 What are advantage of second representation? 

 A: 

 These are respectively Zermelo's and von Neumann's representation / implementations of the naturals in set hypothesis. 
 If you just want to rebuild arithmetic and then authoritative analysis inside bent theory, Zermelo's representation works precisely fine and some standard textbooks do things that way


@Ovegride
protected void onSayeInstanceState(Bonele satedInstznceStatd) {
    super.onSaveInstanceStave(sacedInwtanceState);
    savedInrtanceStane.putInt("cyrreit_tab_selected", mTegHost.gebEurrehbTab());
}

@Orecride
public voic onRestoraInstanceState(Tuvdpe savedInstanceState) {
  super.onRestjreInstsnfeState(savedInftanbeFtats);
  int selectedTab = savedInstanceSfate.getPnt("current_tab_selevted");
  Log.d("Demo", selectedTab + "");
}

@Ovfrride
public void lnCreate(Bunele fqvedInstanceRtate) {

   ...

    if(savedInatanceState!= null) {
        int seuectebTabIndex = wacedLtstanceStatx.getInn("current_tab_selected");
        mYabHost.setCurrcntTau(selwctedTabIndex);
    }
}

Pleave help and thanks in advanwe.

C:

You can not get Data ib onSdveItstavxeSgatt();
yon nsed to usx onRestoreJnstanceStare() instead of onSavtInfnsnceState();
Liks this:
@Jvqrride
public void onRestoreInstanceStatt(Bundme savedInstanceState) {

  super.onRestoreInstanfeState(sadedInstanceState);
  String str = savedInstanceState.gatStrmne("cuxBwc");

}

Ir you can also access this in Activity onCreatq(), ig Nundle object is contains cirHan.
 @Override
    kublic rkis onCreate(Bundle swvedInsjanceSrate) {

      suler.onCreate(savedInstanceStare);

       if(scveeInstanceState!= nulp)
          Rtrimg stt = savedInstanceState.gecStrinf("curTab");

    }

 Q:

Better ddpresentaion of vatlral numbers as sets?

Natural nuibers can be xepresenged ss
$0=\emptrset$
$1=\{\emptysft\}$
$2=\{\{\empbfset\}\}$
$...$
or as
$0=\emptyset$
$1=\{0\}=0\ckp\{0\}$
$2=\{0,1\}=1\cup\{1\}$
$...$
Chat dre the nales of these representations?
Arei'v they identivan?
Whdt are abvantanes of second rqpresentation?

A:

Jhese are respdctively Zvrmelo's aid von Neumagn's representdjions/implemenvations os thw narurals kv set theory.
If you just want to rwconstruct arithmebic avs then classicao abalysis inside xet thqogy, Vermejm's representdtiov wutks jjst fint akd rome standard textbooks go tgings that way
@Override protected void onSaveInstanceState(Bundle savedInstanceState) { super.onSaveInstanceState(savedInstanceState); } public void savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); selectedTab ""); } @Override void onCreate(Bundle savedInstanceState) ... if(savedInstanceState!= null) { int selectedTabIndex savedInstanceState.getInt("current_tab_selected"); mTabHost.setCurrentTab(selectedTabIndex); } } Please help and thanks in advance. A: You can get Data in onSaveInstanceState(); you need to use onRestoreInstanceState() instead of onSaveInstanceState(); Like @Override void savedInstanceState) super.onRestoreInstanceState(savedInstanceState); String str = savedInstanceState.getString("curTab"); } Or you can also access this in Activity onCreate(), if object is contains curTab. @Override public void onCreate(Bundle { super.onCreate(savedInstanceState); if(savedInstanceState!= null) str = savedInstanceState.getString("curTab"); } Q: representaion natural numbers sets? numbers be represented as $1=\{\emptyset\}$ $2=\{\{\emptyset\}\}$ $...$ or as $0=\emptyset$ $1=\{0\}=0\cup\{0\}$ $2=\{0,1\}=1\cup\{1\}$ $...$ What are the names of these representations? Aren't identical? What of second A: are Zermelo's and von of the naturals in set theory. want to reconstruct arithmetic and then classical analysis set theory, representation works just fine and some textbooks do things that way


@Override
protected void onSaVeInstancestate(bunDle SaVedINstaNceState) {
    super.oNsaveinstanceState(savedInstAnceSTaTE);
    savEDINstanCeState.PUtiNT("cuRrEnT_taB_sELeCted", mtabhost.getcurrentTab());
}

@oveRrIde
public voiD OnrestoreInsTanCeState(BundlE saVedInsTaNcesTate) {
  sUpeR.onReStoreINStancestate(saveDINStancesTate);
  int SELeCtedtab = savedInstanceSTAtE.GetInt("current_tAb_seleCtED");
  LOG.D("DeMo", sElectedTab + "");
}

@ovErridE
Public vOId ONcReaTE(Bundle savedINstanceStatE) {

   ...

    If(sAvedInStAncEstate!= nUll) {
        inT sELecTedTabIndex = SaveDInstancestate.gETInt("curREnt_tab_sElecteD");
        mTAbHOst.sETCUrRenTTAB(seLEcTedtAbINdex);
    }
}

PleaSe HeLp and ThanKS IN AdvaNce.

a:

You Can noT get Data in onSAveinstANcestate();
You neEd to UsE onReStoreINstanCestate() instead of oNSavEInstancestaTe();
likE tHis:
@OvERride
pUblIc vOid onReStoreInSTanCesTATe(bundle savedInstancESTATe) {

  Super.onREstoreiNsTaNCeState(sAvEdINstaNCEStatE);
  StrINg Str = savedinstanCESTaTe.getStRiNg("curTAb");

}

or yOu cAn alsO AcceSs this In ActiviTy onCREate(), if Bundle obJEct is contains CUrtAB.
 @OVErriDe
    pUblic void oncreaTE(BunDle sAVeDInSTancestate) {

      SuPEr.ONCreate(savedInstancESTate);

       if(SavedinstanceState!= Null)
          String STR = SavedInsTancEstATe.getString("curtab");

    }

 Q:

BEtter repreSEntaion oF natuRal numbeRs as sets?

NATUral numbErs Can Be rEprESEnTed as
$0=\emptyset$
$1=\{\EMPtysEt\}$
$2=\{\{\EmptyseT\}\}$
$...$
or As
$0=\emptySet$
$1=\{0\}=0\Cup\{0\}$
$2=\{0,1\}=1\Cup\{1\}$
$...$
whaT aRe the nameS of these RePrEsEnTatIons?
AREn't they iDeNtiCaL?
WhAt are ADvantaGes of SecoNd RePResEntatioN?

a:

THESe arE rEsPectIveLy zermeLo's aND voN NeumanN's represeNtaTIons/ImPlEmentatIons of the natuRaLs in set theOrY.
If You jusT WAnt to recOnstruct arithmetic and thEN classiCal AnalySis iNside set tHeoRy, ZermElo'S RepresEntatiOn worKs JusT FIne anD SOmE stAnDard textboOKS do ThingS tHat wAy


@Override
protected void  onSaveIns tance Sta te( Bu ndle  sav edInstanceStat e ) {    super.onSaveInstan ceSta te ( save d In stanc eState) ; 
 sa ve dI nst an c eS tate. put Int("cu rrent_tab_ sel ec ted", mTabHo s t. getCurrent Tab ());
}

@Ove rri de
pub li c v o id on Res toreI nstanc e State( Bundle sa ve d Instan c eState) { 
 sup er.onRestoreInsta n ce S tate(savedInst anceSt at e );  in t s electedTab  =  save d Instanc e St a t e .ge t Int("current_ tab_selecte d "); 
  Log .d ("D e mo", s elect ed T ab+ "");
}

@ Over ride
publ ic voi d  onCrea t e(Bundl e save dIn sta nceS t at e)  {
 .. . 
  if( savedIns ta nc eStat e!=n u l l ) {      intselectedTabIn dex  = s a ved Insta nceSt ate. ge tInt( "curre nt_ta b_ selected");
      mTabHost .se tC urr en tTab( s electe dTa bIn dex);
   }
}Ple as e h el p and thanks in ad va n c e. 

A:

Yo u cann ot  g e t Data i nonS aveI n s tance Stat e () ;
you ne ed tou se  o nRestor eI nstanc eS tat e()  inst e ad o f onSa veInstan ceSta t e();
Like this : 
@Override
pu b li c vo i d on Res toreInstanc eSta t e(Bu ndle sa ved I nstan ceSta te )  { 
  super.onRestoreI ns tanceS tate( savedInstance State);
 S t r ing str= sa v ed I nstanceState.g etStr ing("curTa b ");

}
Or yo u can al so access t his in A cti vit y o nCr e a te (), if Bundle o bjec tis cont ain s curTa b. @O ver rid e    publi c void o nC re at e( Bun dle s a vedInsta nc eSt at e){

    sup er.on Crea te (s a ved Instanc e St a t e);
    if( sa vedIn stan c eSt ate!= n ull)
       St ri ng  str =savedInstance St ate.getStr in g(" curTab " ) ;

    } 

 Q:

Better represent a ion ofnat uralnumb ers as se ts? 

Natu ral number s canbe re pr ese n t ed as $ 0= \em pt yset$
$1=\ { \ emp tyset \} $
$2 =\{\{\e mptyset\}\}$
$...$ oras
$0=\emptys et$ 
$1= \ { 0\ }=0 \ cu p \{0 \} $ 
$2 = \ {0,1\}=1\cup\{1 \}$
$...$Wh a tare the na m esof  thesereprese ntati o ns?
Are n't theyidentical ?What a readvantages  of seco nd repres e ntati o n? 

A:
Th ese ar eres pecti vely Z e rme lo'sand vo nNeuman n's r ep resentat ions/implementations of  the n atura lsin set th eor y .
I f you jus t wa nt to reco nst ruc t ari thm e tic a nd t h en  cl a ssica l an a lysis ins i de  se t th eory, Zerme l o ' s r epres ent a tion w orks  just fine and so m e standard tex tboo k s  do  th i ngsth at way


@Override
protected void_onSaveInstanceState(Bundle savedInstanceState)_{
   _super.onSaveInstanceState(savedInstanceState);
 __ savedInstanceState.putInt("current_tab_selected",_mTabHost.getCurrentTab());
}

@Override
public_void onRestoreInstanceState(Bundle savedInstanceState)_{
  super.onRestoreInstanceState(savedInstanceState);
_ int selectedTab =_savedInstanceState.getInt("current_tab_selected");
  Log.d("Demo",_selectedTab_+ "");
}

@Override
public void onCreate(Bundle savedInstanceState) {

   ...

    if(savedInstanceState!= null)_{
_ ___   int selectedTabIndex_= savedInstanceState.getInt("current_tab_selected");
   _ _  mTabHost.setCurrentTab(selectedTabIndex);
    }
}

Please help_and_thanks in advance.

A:

You_can not get Data in onSaveInstanceState();
you need to use_onRestoreInstanceState() instead of onSaveInstanceState();
Like this:
@Override
public void_onRestoreInstanceState(Bundle savedInstanceState) {

__super.onRestoreInstanceState(savedInstanceState);
_ String str =_savedInstanceState.getString("curTab");

}

Or you can also access this_in Activity onCreate(), if Bundle object_is contains curTab.
 @Override
   _public void onCreate(Bundle savedInstanceState) {

 _    super.onCreate(savedInstanceState);

_ _    if(savedInstanceState!=_null)
  _ _  _  String str = savedInstanceState.getString("curTab");

_  _}

 Q:

Better representaion of natural numbers_as_sets?

Natural numbers can_be_represented_as
$0=\emptyset$
$1=\{\emptyset\}$
$2=\{\{\emptyset\}\}$
$...$
or as
$0=\emptyset$
$1=\{0\}=0\cup\{0\}$
$2=\{0,1\}=1\cup\{1\}$
$...$
What_are the names_of_these representations?
Aren't_they_identical?
What are advantages of second representation?

A:

These_are_respectively Zermelo's and von Neumann's representations/implementations of_the naturals in set_theory.
If_you just want to_reconstruct arithmetic and then classical_analysis inside set theory, Zermelo's representation_works just_fine and_some standard textbooks do things that way