Dialog Theme problem when using dev option "Immediatly destroy activities"

by michael.bollm...@googlemail.com » Sun, 08 Mar 2009 01:09:43 GMT


Sponsored Links
 'm a little lost here... i got some wired behaviour when i enable the
above option.
I guess the problem is about recreating the dialog especially the
activity behind the dialog.

I did the following:
1. open an activity with dialog theme (OK)
2. obscuring the dialog activity with a fullscreen child activity so
it gets destroyed (OK)
3. moving back to the dialog activity (ERROR)

The dialog activity creates just fine but there seems to be a problem
in recreating
the activity behind the dialog activity. It doesn't mater if it's the
homescreen or for example
maps or calculator. The symptoms are always the same.

If i turn "Show Background" on it shows the No-Activity pattern behind
the dialog.

The debugger output suggests that there is some heavy creation/
deletion going on:

03-07 16:51:28.420: VERBOSE/class ...(1563): onResume
03-07 16:51:28.490: INFO/ActivityManager(51): Displayed activity ...:
453 ms
03-07 16:51:28.950: DEBUG/dalvikvm(1495): GC freed 8204 objects /
526176 bytes in 61ms
03-07 16:51:29.511: DEBUG/dalvikvm(1495): GC freed 7465 objects /
483824 bytes in 63ms
03-07 16:51:30.081: DEBUG/dalvikvm(1495): GC freed 8216 objects /
526536 bytes in 71ms
03-07 16:51:30.640: DEBUG/dalvikvm(1495): GC freed 8142 objects /
530960 bytes in 74ms
03-07 16:51:31.200: DEBUG/dalvikvm(1495): GC freed 8144 objects /
531080 bytes in 63ms
03-07 16:51:38.431: DEBUG/dalvikvm(1495): GC freed 7181 objects /
460992 bytes in 62ms
...
...
goes on forever
...
..

Some programs provide a little more output (Here Maps) but obviously
it runs in circles:

03-07 16:55:47.101: VERBOSE/MapActivity(172): Recycling map object.
03-07 16:55:47.120: VERBOSE/StateStack(172): Pushing BlankHelper
03-07 16:55:47.130: INFO/StateStack(172): onRestoreInstanceState
03-07 16:55:47.130: INFO/StateStack(172): Restoring BlankHelper
03-07 16:55:47.170: VERBOSE/MapsActivity(172): Disabling my location
com.google.android.maps.tappablemylocationover...@434efe40
03-07 16:55:47.180: DEBUG/LocationManager(172): removeUpdates:
listener = com.google.android.maps.tappablemylocationover...@434efe40
03-07 16:55:47.191: WARN/NetworkConnectivityListener(172): onReceived
() called with UNKNOWN and Intent
{ action=android.net.conn.CONNECTIVITY_CHANGE (has extras) }
03-07 16:55:47.201: INFO/System.out(172): #### #### Setting locale to
en_US
03-07 16:55:47.201: WARN/MapActivity(172): Recycling dispatcher
com.google.common.datarequestdispatc...@433faf50
03-07 16:55:47.211: VERBOSE/MapActivity(172): Recycling map object.
03-07 16:55:47.301: DEBUG/dalvikvm(172): GC freed 3052 objects /
335264 bytes in 70ms
03-07 16:55:47.301: VERBOSE/StateStack(172): Pushing BlankHelper
03-07 16:55:47.320: INFO/StateStack(172): onRestoreInstanceState
03-07 16:55:47.340: INFO/StateStack(172): Restoring BlankHelper
03-07 16:55:47.390: VERBOSE/MapsActivity(172): Disabling my location
com.google.android.maps.tappablemylocationover...@434ecc20
03-07 16:55:47.390: DEBUG/LocationManager(172): removeUpdates:
listener = com.google.android.maps.tappablemylocationover...@434ecc20
03-07 16:55:47.401: WARN/NetworkConnectivityListener(172): onReceived
() called with UNKNOWN and Intent
{ action=android.net.conn.CONNECTIVITY_CHANGE (has extras) }
03-07 16:55:47.421: INFO/System.out(172): #### #### Setting locale to
en_US
03-07 16:55:47.421: WARN/MapActivity(172): Recycling dispatcher
com.google.common.datarequestdispatc...@433faf50
03-07 16:55



Other Threads

1. Android App Promotions

I have developed an app and the result is pretty good. What should I
do to increase the download?

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

2. Help with Spinner

I am creating a Spinner but when it displays in the Emulator it does
not display any sort of arrow to let the user know to click on it. If
you click on it, it works properly and you can choose from the items.
I have looked through Internet resources and three books but cannot
seem to find an answer to this. Here are my files:
spinner.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >
    <Spinner
      android:id="@+id/testSpinner"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:drawSelectorOnTop="true"
    />
    <Button
      android:id="@+id/enableToggleButton"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:text="Set enable toggle"
    />
    <Button
      android:id="@+id/changeColorButton"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:text="Change Spinner Background Color"
    />
</LinearLayout>

arrays.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
  <string-array name="months">
    <item>Jan</item>
    <item>Feb</item>
    <item>Mar</item>
    <item>Apr</item>
    <item>May</item>
    <item>Jun</item>
    <item>Jul</item>
    <item>Aug</item>
    <item>Sep</item>
    <item>Oct</item>
    <item>Nov</item>
    <item>Dec</item>
  </string-array>
</resources>

TestSpinner.java
package com.aapg.AndroidViews;

import android.app.Activity;
import android.graphics.Color;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.Spinner;

public class TestSpinner extends Activity
{
  private int spinnerBackgroundColor = Color.BLUE;
  //private static final String[] MONTHS = new String[]
          //
{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};

  @Override
  public void onCreate(Bundle savedInstanceState)
  {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.spinner);

        //Get a reference to the Spinner.
        final Spinner testSpinner = (Spinner)findViewById
(R.id.testSpinner);
        testSpinner.setBackgroundColor(Color.BLUE);
        //Set up the ArrayAdapter.
        //ArrayAdapter<String> arrayAdapter = new ArrayAdapter<String>
(this,
                        //android.R.layout.simple_spinner_item,
MONTHS);
        ArrayAdapter<CharSequence> arrayAdapter =
ArrayAdapter.createFromResource(this,
                        R.array.months,
android.R.layout.simple_spinner_item);
        //Set up the DropDownViewResource.
        arrayAdapter.setDropDownViewResource
(android.R.layout.simple_spinner_dropdown_item);
        //Attach the Spinner to the ArrayAdapter.
        testSpinner.setAdapter(arrayAdapter);

        final Button enableToggleButton = (Button)findViewById
(R.id.enableToggleButton);
        enableToggleButton.setOnClickListener(new
Button.OnClickListener()
        {
          public void onClick(View v)
          {
                changeEnabled(testSpinner);
          }//onClick().
        });//Button.setOnClickListener().

        final Button changeColorButton = (Button)findViewById
(R.id.changeColorButton);
        changeColorButton.setOnClickListener(new Button.OnClickListener
()
        {
          public void onClick(View v)
          {
                changeSpinnerBackgroundColor(testSpinner);
          }//onClick().
        });//Button.setOnClickListener().
  }//onCreate().

  public void changeEnabled(Spinner testSpinner)
  {
        if(testSpinner.isEnabled())
        {
      testSpinner.setEnabled(false);
        }//if(testSpinner.isEnabled()).
        else
        {
      testSpinner.setEnabled(true);
        }//else.
  }//changeEnabled(Spinner testSpinner2).

  public void changeSpinnerBackgroundColor(Spinner testSpinner)
  {
        if(spinnerBackgroundColor == Color.BLUE)
        {
          testSpinner.setBackgroundColor(Color.YELLOW);
          spinnerBackgroundColor = Color.YELLOW;
        }//if(SPINNER_BACKGROUND_COLOR == Color.BLUE)
        else
        {
          testSpinner.setBackgroundColor(Color.BLUE);
          spinnerBackgroundColor = Color.BLUE;
        }//else.
  }//changeSpinnerBackgroundColor(Spinner testSpinner).

}//AutoComplete class.

Thanks for your help.

EverettG.

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

3. gcc: error trying to exec 'cc1': execvp: No such file or directory

4. About Content Provider and SQLite Table design pattern

5. Pre-Order 3G[S] dan HTC Hero Android G2

6. do i need to close cursor?

7. Printing from Android - the Brother MW-120 mobile printer