May 20, 2014

Switch Activity In An Android Application (Switch Screens)

In Android Screens Are Called As Activity.
Now I Will Teach You How To Switch Between Activity(Screens) On An Android Project..
Its Simple As ABC.

1. Go to the src folder in your application and expand it.
2. You will find your package which you has created before. Now Expand That.
3. Now open the java file relevant to your activity.
4. For example if you want to go to a new activity on a button click then.
    Make your button click event and then paste this code inside your button click function

* change current_activity_class_name.this to your current class.this  
* change next_activity_class_name to your next_class.class 

startActivity(new Intent(current_activity_class_name.this,next_activity_class_name.class));

* Use this if you want the current activity to be destroyed
finish(); 



* You Will Have To Import Some Classes When You Put This Code.
* Press ctrl+shift+o   then it will automatically fix your imports

No comments:

JWT Token Decode Using Jquery

When it come to authentication we use many mechanism. Ones the user authenticated we must keep these details somewhere safe. So we can share...