I am developing an application in android which has a login Screen. Right now I am able to receive the response from the server successfully. After a successful response it should take me to the next activity or class where I display a new screen/activity. what should I do in order to achieve this.
You need to use Intent Class in order to redirect from one activity class to another activity class. onOptionsItemSelected() Method will be trigged when you click the 'show setting' menu in the action bar.
In Android you are using Intents to change from one Activity to another. In this case you would use an explicit Intent. In code this would like this:
Intent goToNextActivity = new Intent(getApplicationContext(), YourNewClass.class);
startActivity(goToNextActivity);
Be sure to add YourNewClass to the manifest as another activity like this:
<activity android:name=".your.package.YourNewClass" />
Have a closer look at the documentation of Intent. You can also read the document about application fundamentals in the documentation it is somewhat to deep to just answer this question but it will give you insights in the most important concepts of android.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With