Android – intent.putextra does not work
•
Android
I need to pass information between two activities, but for some reason, the information will not be sent / received
Logcat won't give me any errors. The debugger clearly shows that some content (variabl: mextras) has been added in the intention, but it is difficult to accurately explain the added content. After that, it gives me "no source" and doesn't help me
But the first thing to do. Am I right so far?
send out:
Intent intent = new Intent ( this, TaskListActivity.class );
intent.putExtra ( ProjectManager.ID, mId.toString () );
startActivity ( intent );
Recieving:
Intent intent = getIntent ();
mId = UUID.fromString ( intent.getStringExtra ( ProjectManager.ID ) );
resolvent:
Add the following code after the intent:
Bundle extras = intent.getExtras();
String exampleString = extras.getString(ProjectManager.ID);
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码