How do I start a new Activity with an if-statement?
<p>I basically want to start a new Activity, but here is the catch:
I want the new Activity to start, when an "if-statement" is true.
I created a simple counter and when the user reaches a certain number, lets say 10, the new activity should start.
Thanks in advance!</p>

<p>Here is some code:</p>

<pre><code>public class MainActivity extends AppCompatActivity {

    //NUMBER FOR THE COUNTER
    public int mCount = 100;


    //SUBTRACTS 1 FROM THE COUNTER
    public void remove() {
        mCount--;
        if (mCount &lt;= 0) mCount = 0;


    }

    //UPDATES THE COUNTER
    private void updateGui() {
        TextView textViewCount = (TextView) findViewById(R.id.textViewCounter);
        String CountText = Integer.toString(mCount);
        textViewCount.setText(CountText);

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
</code></pre>