开发者

Set property in parent activity

开发者 https://www.devze.com 2023-03-07 15:42 出处:网络
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\"

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消