Android onClick() assistance with method call
<p>I have a method which is called when the user hits my create button, this calls a method names createEntry();</p>

<p>within this method it goes through several checks and returns toasts or errors depending on the outcome, when it runs the correct outcome it always takes me back to my home activity but i want it to stay on the current screen if there is an error, how can i do this?</p>

<p>Can anyone give me some assistance with this please</p>

<pre><code>public void onClick(View v) {
    switch (v.getId()) {
    case R.id.create_button:
        Intent i = new Intent(this, Home.class);
                    createEntry();// this is where my error checking is done so what I would like to know is how can i stay on the current screen for certain errors
        startActivity(i);
        break;
}
}

    }
</code></pre>

<p>i don't want to load the home class if there is an error i want it to stay on the current screen.</p>
