It is possible to bind android UI dynamically at run-time and keep the changes saved to be visible in the next time I have run the application on the device !?
Asked
Active
Viewed 603 times
2 Answers
1
You can change the UI diagrammatically. Save the chances (there is no standar way) to Shared Preferences and then onCreate check is there are any changed need to be mabe (by looking at SharedPreferences) and perform them before you draw the UI

weakwire
- 9,284
- 8
- 53
- 78
-
Good idea!. but how much SharedPreferences can carry data ? – Adham Sep 21 '11 at 22:17
-
Well i don't thing there is a limit to that. (Internal phone memory maybe). But you will only need to keep the changed from the original state. So for eg. if you move the object only need to keep the new position and move it on start. Don't think you will have overCapacity problems, or even near that.! – weakwire Sep 21 '11 at 22:24
-
ok , what actually want to do is for example , I have application which have a button , when i add a button it add a new view, such as text view, next time I open the application I want to see this added text view – Adham Sep 21 '11 at 22:26
-
1save buttonPressed ="true" to preferences. the onCreate. if (buttonPressed) createTheNewView() – weakwire Sep 21 '11 at 22:27
0
Not that I know of. Any changes made while your app is running should be saved/reloaded using the Activity life cycle functions as described in this question: Saving Android Activity state using Save Instance State
If there is something specific you are trying to do that won't work with that design pattern, please give more details.

Community
- 1
- 1

Eric Brynsvold
- 2,880
- 3
- 17
- 22
-
for example , I have application which have a button , when i add a button it add a new view, such as text view, next time I open the application I want to see this added text view – Adham Sep 21 '11 at 22:20
-
Application state is deleted when the application is closed. onDestroy() so any changes will be lost that way – weakwire Sep 21 '11 at 22:25
-
-
Using preferences as weakwire is suggesting should work just fine. Though, depending on how much information you are trying to save, it could get complex quickly and might be better to use a database. – Eric Brynsvold Sep 21 '11 at 22:32