Android: Not receiving the extra intent ID -


hi i'm trying send data textview activity in destination activity doesn't pick intent data id. clarify, in destination activity not recognize variable "username" . how fix this?

mainactivity activity (sender)

public  final static string username = "com.example.eugen.test.mainactivity.etusername";   intent destination_intent = new intent(this, destination.class);             destination_intent.putextra(username,etusername.gettext());             startactivity(destination_intent);  

destination activity

string usernamereceived = null; usernamereceived = getintent().getstringextra(destination.username); 

just change destination.username mainactivity.username variable username declared static in mainactivity. , ivan v suggested, practice create constants file , declare static constants there, make things more cleaner.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -