Slow startup of second activity
<p>What should I look when my settings <code>Activity</code> is starting up really slow? Sometimes I get <code>ANR keyDispatch error</code> if it takes to long.</p>

<p>Should also say that I am using <code>PreferenceActivity</code>. The absolute first time I go into settings the delay time is really slow (about 5-10 seconds), but otherwise it goes super smooth. This does appear when I'm reinstalling the application and start the settings for another first time (so it's a first time thing).</p>

<p>Some code in my settings <code>PreferenceActivity</code>:</p>

<pre><code>@Override
protected void onCreate(Bundle icicle) {
    super.onCreate(icicle);

    pref = getPreferenceManager();    

    pref.setSharedPreferencesName(LiveWallpaper.PREFERENCES);
    addPreferencesFromResource(R.xml.live);
    pref.getSharedPreferences().registerOnSharedPreferenceChangeListener(this);

    pref.findPreference("Username").setOnPreferenceClickListener(new OnPreferenceClickListener() {          
        public boolean onPreferenceClick(Preference preference) {
                                          // Stuff...
                return true;                
            }
        }
    );
// And so on...
</code></pre>

<p>Basically, I want to find out where this error is located, the question is how? Can I see in LogCat WHAT it is that's causing the delay?</p>

<p>Thanks for any answer!</p>
