Set property in parent activity
When i create a new activity from a开发者_开发百科 class A. Is it then possible to set a property in the parent object (i.e. A) from the new activity?
It sure is. If you pass a reference to "class A" to the new Activity, you can call "setter" methods on that original class. Or you could use the getParent()
method within the Activity class. Or you can use a SharedPreference if you want it to a be a permanent property.
Or you can use setResult.
精彩评论