title: how to save state with onSaveInstanceState and onRestoreInstanceState while orientation change
body: <p>I read almost all article about onSaveInstanceState and onRestoreInstanceState in Stack overflow but I cant solve my problem. <br />
  I have a text view and button in my main.java and while you click on button value of a ( <strong>a</strong> is an int variable) variable will increase and show in the text view, but, when I rotate my phone ( orientation change), text view reset. </p>
  
  <p>I override onSaveInstanceState and onRestoreInstanceState but it doesn't work.
  one more thing, I have special layout-land.xml file for landscape view.</p>
  
  <p>here is my code</p>
  
  <pre><code> import android.app.Activity; 
   import android.graphics.Typeface; 
   import android.os.Bundle;
   import android.view.View;
   import android.widget.Button;
   import android.widget.TextView;
  
   public class main extends Activity {
       /** Called when the activity is first created. */   
     public int a = 0;     
     public String fonts="TAHOMA.TTF";
  
     TextView tv = (TextView) findViewById(R.id.salavat);      
     Button b = (Button) findViewById(R.id.showsalavat);
  
     @Override
     public void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.main);
         b.setOnClickListener(new Button.OnClickListener() {
              public void onClick(View arg0) {
                 a++;
                 tv.setText(""+a);
              }
         });
     }
     @Override        
     protected void onSaveInstanceState(Bundle SavedInstanceState) {
        super.onSaveInstanceState(SavedInstanceState);            
        SavedInstanceState.putInt("salavat-count", a);
     }
     @Override    
     protected void onRestoreInstanceState(Bundle savedInstanceState) {
         super.onRestoreInstanceState(savedInstanceState);     
         a= savedInstanceState.getInt ("salavat-count");   
     } 
  }
  </code></pre>
  
  <p>and here my main.xml</p>
  
  <blockquote>
    <blockquote>
      <p>
          </p>
    </blockquote>
  
  <pre><code>    &lt;TextView
          android:id="@+id/shoma"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:gravity="right"
          android:text="@string/shoma"
          android:textSize="20sp" /&gt;
  
      &lt;Button
          android:id="@+id/showsalavat"
          android:layout_width="fill_parent"
          android:layout_height="150dp"
          android:text="+"
          android:textSize="100sp" /&gt;
  
      &lt;TextView
          android:id="@+id/eltemas"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginBottom="55dp"
          android:text="@string/eltemas" /&gt;
  
      &lt;TextView
          android:id="@+id/salavat"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Large Text"
          android:textAppearance="?android:attr/textAppearanceLarge"
          android:textSize="35sp" /&gt;
  
      &lt;TextView
          android:id="@+id/ferestade"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_marginBottom="24dp"
          android:text="@string/salavat"
          android:textSize="20sp" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  </blockquote>
  
  <p>I really need some help on this.
  I really appreciate your help.</p>