开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜