SDK 2.0: wrong behaviour after convertion from SDK1.6 - please help!

by Evgeny V » Sun, 29 Nov 2009 01:22:31 GMT


Sponsored Links
 Hi!

I got infinit loop when trying to run activity which creating dialog.
Before I'm pressing the dialog button OK or Cancel button the system is
startong my tab main activity again.
It worked fine in all previouse versions.
 The log report:
*11-28 16:59:38.607: WARN/UsageStats(59): Something wrong here, didn't
expect evgeny.converter to be resumed
11-28 17:12:06.498: ERROR/WindowManager(269): android.view.WindowLeaked:
Activity evgeny.converter.TabMain has leaked window
com.android.internal.policy.impl.phonewindow$decorv...@43cfd4f0 that was
originally added here
*
Thanks in advance,
Evgeny

The code is as following:
Launcher code:
  SharedPreferences _State;
     @Override
     protected void onCreate(Bundle savedInstanceState) {

      super.onCreate(savedInstanceState);

         final TabHost tabHost = getTabHost();

         tabHost.addTab(tabHost.newTabSpec("tabMeasures")
                 .setIndicator(res.getString(R.string.tab_measures_title),
                 res.getDrawable(R.drawable.measures_tab_32))
                 .setContent(new Intent(this, MeasuresMain.class)));

         tabHost.addTab(tabHost.newTabSpec("tabClothes")
                 .setIndicator(res.getString(R.string.tab_clothes_title),
                 res.getDrawable(R.drawable.clothes_tab_40))
                 .setContent(new Intent(this, ClothesMain.class)));
         tabHost.addTab(tabHost.newTabSpec("tabSettings")
                 .setIndicator(res.getString(R.string.tab_settings_title),
                 res.getDrawable(R.drawable.settings_tab_40))
                 .setContent(new Intent(this,
ConverterViewSettings.class)));

         tabHost.setBackgroundResource(R.drawable.background_main);

         _State = getSharedPreferences("Settings", MODE_WORLD_READABLE |
MODE_WORLD_WRITEABLE );
         if(_State.getBoolean(ConverterUtil.EVG_IS_SHOW_LICENSE_AGREEMENT,
true))
          showDialog(1);

     }

@Override
     protected Dialog onCreateDialog(int id)
     {
      AlertDialog.Builder builder = new AlertDialog.Builder(this);
      builder.setPositiveButton(R.string.lblButtonAgree, new
DialogInterface.OnClickListener()
      {
       public void onClick(DialogInterface dialog, int whichButton)
       {
              try
              {
               SharedPreferences.Editor editor = _State.edit();

editor.putBoolean(ConverterUtil.EVG_IS_SHOW_LICENSE_AGREEMENT, false);
               editor.commit();
              }
              catch (Exception e)
              {
         e.printStackTrace();
        }
       }
      });
      builder.setNegativeButton(R.string.lblButtonExit, new
DialogInterface.OnClickListener()
      {
       public void onClick(DialogInterface dialog, int whichButton)
       {
        finish();
       }
      });

      LayoutInflater inflater = LayoutInflater.from(this);
            builder.setTitle(R.string.lblLicenseCaption);
            builder.setIcon(R.drawable.my_converter_32);
      ScrollView layout = (ScrollView) inflater.inflate(R.layout.about,
null);

  
((TextView)layout.findViewById(R.id.txtAbout)).setText(R.string.lblLicenseText);

  
((TextView)layout.findViewById(R.id.txtMyEmail)).setVisibility(LinearLayout.GONE);
      builder.setView(layout);
      return builder.create();
     }

--



Other Threads

1. changing a package name

Hello
This is more a Java question than Android....
I have a graphing routine AChartEngine (very very good by the way).
Now I want to link this with another routine say a sound recording
activity. They are in different packages and different projects.
AChartEngine has lots of Lib's and Referenced Libraries, so it's
easier to move the other stuff there. However the charting demo has
the demo package name and the demo project name.

What is the best way to move these things about? Is there a sensible
text which explains more about packages and libraries etc?
Thanks
John

-- 

2. root modaco

Para Suhu sekalian,

lagi tertarik untuk ngeroot hero dengan modaco tetapi masih bingung cara
backup dengan nandroid. sudah bongkar arsip milis namun belum ketemu juga.

Bisa dapat pencerahan untuk jalankan nandroid?

Semoga bisa bongkar (root) hero sabtu besok.

Terima kasih dan Salam,
Hermanto

--~--~---------~--~----~------------~-------~--~----~
Google Groups "Indonesian Android Community [id-android]" group.

To post to this group, send email to id-android@googlegroups.com

To request to subscribe to this group:

Click  

3. Get a free Archos 5 Internet Tablet with Android (8GB) if you publish an app on http://appslib.com

4. Saya install GDE,trs download theme nya di market.cara ganti theme yg udh di download gmn caranya?

5. GPS failing with SecurityException

6. Eclair base theme on Cyanogen

7. Disappearing MapView zoom controls