title: Add another counter in the system
body: <p>I've got one counter in this project its all working but I'm trying to put another counter at the bottom of the screen that will do the same but will work on another count. So there are gonna be two counters counting differently, but I can't get it to work.</p>
  
  <p><strong>xml code:</strong></p>
  
  <pre><code>&lt;TextView
      android:id="@+id/TextViewCount"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_centerHorizontal="true"
      android:layout_centerVertical="true"
      android:text="@string/hello_world" /&gt;
  
  &lt;Button
      android:id="@+id/ButtonCount"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:layout_above="@+id/TextViewCount"
      android:layout_alignRight="@+id/TextViewCount"
      android:layout_marginBottom="22dp"
      android:text="Count" /&gt;
  </code></pre>
  
  <p><strong>Main Code:</strong></p>
  
  <pre><code>package com.example.counter;
  
  import android.app.Activity;
  import android.content.SharedPreferences;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.TextView;
  
  
  public class MainActivity extends Activity {
   // Private member field to keep track of the count
   private static int mCount = 0;
  
  private TextView countTextView;
  private Button countButton;
  public static final String PREFS_NAME = "com.example.myApp.mCount";
  private SharedPreferences settings = null;
  private SharedPreferences.Editor editor = null;
  
      /** ADD THIS METHOD **/
      @Override
      public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);  
        setContentView(R.layout.main);
        countTextView = (TextView) findViewById(R.id.TextViewCount);
        countButton = (Button) findViewById(R.id.ButtonCount);
  
        countButton.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                mCount++;
                countTextView.setText("Count: " + mCount);
                editor = settings.edit(); 
                editor.putInt("mCount", mCount);
                editor.commit();
            }
        });
      settings = getSharedPreferences(PREFS_NAME, MODE_PRIVATE);
  
  
       }
  
      @Override
      public void onPause() {
        super.onPause();  
      }
  
      @Override
      public void onResume() {
        super.onResume();  
        mCount = settings.getInt("mCount", 0);
        countTextView.setText("Count: " + mCount);
      }
      }
  </code></pre>