PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "Browser");
+ // Find out if the network is currently up.
+ ConnectivityManager cm = (ConnectivityManager) getSystemService(
+ Context.CONNECTIVITY_SERVICE);
+ NetworkInfo info = cm.getActiveNetworkInfo();
+ if (info != null) {
+ mIsNetworkUp = info.isAvailable();
+ }
+
/* enables registration for changes in network status from
http stack */
mNetworkStateChangedFilter = new IntentFilter();
mTitleBar.setInVoiceMode(false);
mFakeTitleBar.setInVoiceMode(false);
- mTitleBar.setDisplayTitle(mTitle);
- mFakeTitleBar.setDisplayTitle(mTitle);
+ mTitleBar.setDisplayTitle(mUrl);
+ mFakeTitleBar.setDisplayTitle(mUrl);
}
/* package */ static String fixUrl(String inUrl) {
// FIXME: Converting the url to lower case
hideFakeTitleBar();
}
}
- } else if (!mInLoad) {
- // onPageFinished may have already been called but a subframe is
- // still loading and updating the progress. Reset mInLoad and update
- // the menu items.
- mInLoad = true;
- updateInLoadMenuItems();
+ } else {
+ if (!mInLoad) {
+ // onPageFinished may have already been called but a subframe is
+ // still loading and updating the progress. Reset mInLoad and
+ // update the menu items.
+ mInLoad = true;
+ updateInLoadMenuItems();
+ }
+ // When the page first begins to load, the Activity may still be
+ // paused, in which case showFakeTitleBar will do nothing. Call
+ // again as the page continues to load so that it will be shown.
+ // (Calling it will the fake title bar is already showing will also
+ // do nothing.
if (!mOptionsMenuOpen || mIconView) {
// This page has begun to load, so show the title bar
showFakeTitleBar();