How to transfer some data to another Fragment
likewise it was done with extras
for intents
?
转自:http://stackoverflow.com/questions/7149802/how-to-transfer-some-data-to-another-fragment
How to transfer some data to another Fragment?
15
6
| |
add comment (requires an account with 50 reputation) |
42
|
Use a Bundle. Here's an example:
Bundle has put methods for lots of data types. Seehttp://developer.android.com/reference/android/os/Bundle.html Then in your Fragment, retrieve the data (e.g. in onCreate()) with:
| ||
|
3
|
getArguments() is returning null because "Its doesn't get anything" Try this code to handle this situation
| ||
add comment (requires an account with 50 reputation) |