Android: Reusing an activity stored as local variable in another activity -
itemprop = "text">
I have two activities in my Android 2.1 application.
The first main activity, in which
is the second setting setting, which offers settings to adjust the parameters used within the main.
There is currently a setting activity within my main category. Class examples I read the settings from this example in Maine.
See the public class applies the main activities. OnClickListener, View.OnTouchListener {secure setting settings; } The list of public category settings activity tools extends to the adapter {} , I have come to know that if my setting activity is already created, then only one continuous example To make sure:
within // main.java: intent = intent (new, new) (this, settings.class); Intent.setFlags (Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); // Reuse this current settings Initial activity (intent); My problem is how can I tie it primarily with the local 'settings' member.
Can someone start me as a quick example of how my local 'settings' frequency can be used as a reusable activity?
Many thanks
I currently have my main class The activity of a setting, for example a class example.
Delete this immediately . One activity should not be placed on any other activity, because it is a result in memory leaks. I guarantee you that whatever problem you feel that you are solving in this way, there are better ways to do it. My problem is how can I tie it with the local 'settings' member?
By removing the "local" setting 'member' in the main, this problem is resolved.
In addition, please use shared references and priority to collect "settings" wherever possible. For example, if "home in the local" setting is behind the 'member', to allow the main to use the settings, a share for the right code To use those objects and main for those SharedPreferences to use. Using Preferences gives the user the benefit of taking a look and feel that they expect an app to provide the settings.
Comments
Post a Comment