android - Should onSaveInstanceState save the "enabledness" of the views? -


My preferences are where I can change the language of my application and my application. From there I came back to the previous activity through the key, and I want to recreate the activity.

I have tried to restart the layout in onResume and call onRestoreInstanceState from there

but I have There is a button that has already become inactive, and only when a radio explosion should be checked. The problem with this is: I check the radio button, the button is enabled, then I go to settings, change the theme there, and come back to the first activity. When I get there, the radiobutan is checked, but the button has been disabled.

It seems that the competent / incompetent state is not being saved in the bundle, which seems to be the opponent. And I do not find any code in the Android source which also does this. Am I missing something, or do I have to write my code for it?

EDIT: BTW, the state is only saved for those who have ID and I have one in that button, I guarantee it :)

The key here is to see what exactly is the button enabled and to ensure that every access to the app is compatible. .

From your statement:

But I have a button that is initially disabled, and only when a radio explosion is checked.

It appears that you have a listener on the radioobutan that enables the button; By this, I assemble that the button has been initially disabled, which means That every time you run the activity you have to change it.

Your options are as follows:

  • Radiobutan sets any type of global priority on which the check is done in the resume, when the button is required
  • When the radioabutan is checked, change the global settings (or perhaps GUI settings) to a button where a button is enabled.
  • When you mention the cheapest instancestate, you can live forever until you save efficiency

It is difficult to say which is the most suitable because you do not Used to refer to the case of use, but I would have to avoid sending it through the bundle until it is a very used activity

Then store it or change the view until the notice changes Hang attitude Rediodn setting.


Comments