Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a login form where after successful login i need to display the name of user in all the screen. i tried it using intents but the name is not consistent across all the activities some screen shows username and others null. is there any other way to achieve this?

this is how i did now. but the result is not consistent
Java
Intent next=new Intent(getApplicationContext(),RoomsConfiguration.class);
                next.putExtra("iUserID",iUserID);
                startActivity(next);


Java
Intent next=getIntent();
        iUserID = next.getStringExtra("id");
        tv.setText(new StringBuilder().append("Logged as ").append(iUserID));
Posted

 
Share this answer
 
For starters you're using iUserID to set the data and id to get it.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900