Dialog Survival Over Configuration Change

by Marco Nelissen » Thu, 05 Mar 2009 01:22:00 GMT


Sponsored Links
 


Why do you say that? Opening or closing the keyboard counts as a
configuration change, so it's something that can happen at any time.


Unless you take measures to avoid it, a configuration change will
cause your activity to be destroyed and recreated with the new
configuration. It goes through the normal activity lifecycle when
doing this, so to the current activity is paused, stopped and
destroyed, and the new activity is created, started and resumed.

--~--~---------~--~----~------------~-------~--~----~



Dialog Survival Over Configuration Change

by Romain Guy » Thu, 05 Mar 2009 02:57:05 GMT


 orry I got confused, you want removeDialog(), not dismissDialog().
The latter only closes the dialog but it is still known as a managed
dialog. removeDialog() on the other hand tells the Activity to forget
about the dialog *and* to dismiss it.

On Wed, Mar 4, 2009 at 10:53 AM, Nmix <nepean...@gmail.com> wrote:



--
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support. All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Dialog Survival Over Configuration Change

by Dianne Hackborn » Thu, 05 Mar 2009 10:23:58 GMT


  think you are getting yourself into a more and more tangled mess.  As a
fairly broad rule, you shouldn't be doing any state-changing behavior in
onSaveInstanceState() -- this is not for the system to tell you about
something interesting happening, but for it to get your current state at
whatever point it thinks it might need it.

Could we back up and look at exactly what you are trying to do? In which
situations do you want the dialog to stay, and in which do you want it to
disappear? This shouldn't be in terms of "when state is saved" or "when it
is destroyed", but "when the user flips the lid / changes the
configuration," "when the user presses home," "when the user switches to
another activity," etc.

On Wed, Mar 4, 2009 at 5:28 PM, Nmix <nepean...@gmail.com> wrote:



--
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support. All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~



Dialog Survival Over Configuration Change

by Romain Guy » Fri, 06 Mar 2009 13:14:13 GMT


 gt;> It is a problem. In my, and others', opinion it is a *bug* that the

It is a bug indeed.




--
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support. All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. Self contained ProgressDialog in ListFragment?

I have a ListFragment which loads data in a background thread and shows a
ProgressDialog while it loads. I'm wondering if I can make that dialog
contained to just that fragment so the user can keep doing things in the
other fragments. Is this doable?  Currently, the dialog blocks all
interaction with the UI.

--
Chris Stewart
http://chriswstewart.com

-- 

2. What is the correct way to pause AudioTrack?

I wrote the following code to experiment with the AudioTrack class but
whenever I click the pause button it seems to "REWIND" the track
rather than pause it, am I doing something wrong?
private class PlayAudio extends AsyncTask<Void, Void, Void> implements
                        OnPlaybackPositionUpdateListener {
                AudioTrack audioTrack;
                boolean keepGoing = true;


                boolean speed = false;

                @Override
                protected Void doInBackground(Void... params) {
                        int bufferSize = AudioTrack.getMinBufferSize(frequency,
                                        channelConfiguration, audioEncoding);

                        audioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, 
frequency,
                                        channelConfiguration, audioEncoding, 
bufferSize,
                                        AudioTrack.MODE_STREAM);

                        audiodata = fillBuff(myAudio);

                        audioTrack.setPlaybackPositionUpdateListener(this);

                        audioTrack.play();

                        // This while block ensures that a buffer is 
continuously
replenished.
                        while (keepGoing) {
                                audioTrack.write(audiodata, 0, 
audiodata.length);
                        }

                        return null;
                }

                @Override
                public void onMarkerReached(AudioTrack track) {

                }

                @Override
                public void onPeriodicNotification(AudioTrack track) {

                }

                protected void onPostExecute(Void result) {
                }

        }



public void onClick(View v) {
                int id = v.getId();
        if (id == R.id.PausePlaybackButton) {
                        // playTask.maKorin = false;

                        playTask.audioTrack.pause();
        }


//...

}

-- 

3. StartActivity and InstantiationException

4. galaxy 5 kadang restart klo pas lg maen HEAVY GUNNER

5. Nubie minta izin.

6. Scanner GPRS

7. [WTA] most oprekable android