Note that there are some explanatory texts on larger screens.

plurals
  1. POsetContentView() slow with map fragment
    primarykey
    data
    text
    <p>I am working on an app that shows a google map (api v2) as a fragment. When the app loads it shows a blank white screen for a couple of seconds before showing the map. I have used log statements see where the delays is but I don't know why it's so slow.</p> <p>Here is my onCreate:</p> <pre><code>@Override protected void onCreate(Bundle savedInstanceState) { Log.i(TAG, "onCreate Start -------------------------------"); super.onCreate(savedInstanceState); Log.i(TAG, "onCreate 1 -------------------------------"); setContentView(R.layout.activity_main); Log.i(TAG, "onCreate 2 -------------------------------"); do_async_setup(); Log.i(TAG, "onCreate 3 -------------------------------"); prefs = getSharedPreferences(PREFS_NAME, 0); prefs_editor = prefs.edit(); Log.i(TAG, "onCreate Finish -------------------------------"); </code></pre> <p>And here is the output.</p> <pre><code>01-20 10:05:28.802: I/HeadsUp(19544): onCreate Start ------------------------------- 01-20 10:05:28.802: I/HeadsUp(19544): onCreate 1 ------------------------------- 01-20 10:05:30.396: I/HeadsUp(19544): onCreate 2 ------------------------------- 01-20 10:05:30.396: I/HeadsUp(19544): onCreate 3 ------------------------------- 01-20 10:05:30.403: I/HeadsUp(19544): onCreate Finish ------------------------------- </code></pre> <p>You can see a 1.5 sec delay for setContentView. Here is my layout.</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".MainActivity" &gt; &lt;fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.SupportMapFragment"/&gt; &lt;/RelativeLayout&gt; </code></pre> <p>It's simply looks bad, like the app has frozen when loading. How can I either speed this up or hide the delay? </p> <p>thanks,</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload