开发者

main layout settings gone after layout change

I change the layout in my App for d开发者_运维技巧ifferent reasons like,a settings or about sub-layout. But when I go back to the main layout, every setting there is gone: no Buttonlistener is set anymore and the EditTextfields do contain the standart text. How can I change that behaviour? Is there some other function like onConfigurationChanged(), which handles "inside" calls of a layout in an action?


Well due to the fact nobody answered yet and i did figured it out, i'll post my Solution as an answer even though I suspect there might be a more elegant way:

Every time you change a layout using setLayout(...) you first have to save your configuration like described here. Then when you change back to the "old" layout you have to get your resources dynamicly and load and set the old settings like:

edit_text_one = (EditText) findViewById(...);
edit_text_one.setText(settings.getString("text","text"));
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜