Using Intent Change One Activity to another Activity and also pass
Main Activity Username to sub activity and display in Sub Activity
a) Create Sample Application With login module. (Check Username and Password)
b) On Successful Login , go to next Screen , And on Failing login , alert user using Toast. Also Pass Username to next Screen.
Below android program will ask you to enter username and password and a button to submit the text to next screen.
when you press the submit button the username you have entered in the edittext view will be passed to the sub activity.
to create such application you need to use startActivity and pass the intent object which will start sub activity. and add the putExtra method to Pass value along with the activity
from the sub activity page you need to use getintent() to get the last intent which will return the intent refrence.
from the specified intent reference you call the appropriate get method to access the value in sub activity page
Download Activity and Sub Activity Example
Your Comment are most Welcome. if you find any difficulty in this you can comment us
No comments:
Post a Comment