зеркало из https://github.com/mozilla/pjs.git
bug 706574 - show native about:home in onCreate() r=dougt a=blassey, java only
This commit is contained in:
Родитель
012f74ac00
Коммит
e1cf09ec72
|
@ -1252,6 +1252,7 @@ abstract public class GeckoApp
|
|||
public void onCreate(Bundle savedInstanceState)
|
||||
{
|
||||
System.loadLibrary("mozutils");
|
||||
mMainHandler = new Handler();
|
||||
Log.w(LOGTAG, "zerdatime " + new Date().getTime() + " - onCreate");
|
||||
if (savedInstanceState != null) {
|
||||
mLastUri = savedInstanceState.getString(SAVED_STATE_URI);
|
||||
|
@ -1259,6 +1260,18 @@ abstract public class GeckoApp
|
|||
mLastViewport = savedInstanceState.getString(SAVED_STATE_VIEWPORT);
|
||||
mLastScreen = savedInstanceState.getByteArray(SAVED_STATE_SCREEN);
|
||||
}
|
||||
String uri = getIntent().getDataString();
|
||||
String title = uri;
|
||||
if (uri != null && uri.length() > 0) {
|
||||
mLastUri = uri;
|
||||
mLastTitle = title;
|
||||
}
|
||||
|
||||
if (mLastUri == null || mLastUri.equals("") ||
|
||||
mLastUri.equals("about:home")) {
|
||||
showAboutHome();
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 9) {
|
||||
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
|
||||
.detectDiskReads().detectDiskWrites().detectNetwork()
|
||||
|
@ -1342,8 +1355,6 @@ abstract public class GeckoApp
|
|||
if (sGREDir == null)
|
||||
sGREDir = new File(this.getApplicationInfo().dataDir);
|
||||
|
||||
mMainHandler = new Handler();
|
||||
|
||||
if (!sTryCatchAttached) {
|
||||
sTryCatchAttached = true;
|
||||
mMainHandler.post(new Runnable() {
|
||||
|
|
|
@ -64,16 +64,6 @@ public class GeckoThread extends Thread {
|
|||
|
||||
public void run() {
|
||||
final GeckoApp app = GeckoApp.mAppContext;
|
||||
Intent intent = mIntent;
|
||||
String uri = intent.getDataString();
|
||||
String title = uri;
|
||||
if (!app.mUserDefinedProfile && (uri == null || uri.length() == 0)) {
|
||||
uri = mUri;
|
||||
title = mTitle;
|
||||
}
|
||||
if (uri == null || uri.equals("") || uri.equals("about:home")) {
|
||||
app.showAboutHome();
|
||||
}
|
||||
File cacheFile = GeckoAppShell.getCacheDir();
|
||||
File libxulFile = new File(cacheFile, "libxul.so");
|
||||
|
||||
|
@ -106,18 +96,17 @@ public class GeckoThread extends Thread {
|
|||
|
||||
// and then fire us up
|
||||
|
||||
final String activityTitle = title;
|
||||
app.mMainHandler.post(new Runnable() {
|
||||
public void run() {
|
||||
app.mBrowserToolbar.setTitle(activityTitle);
|
||||
app.mBrowserToolbar.setTitle(mTitle);
|
||||
}
|
||||
});
|
||||
try {
|
||||
Log.w(LOGTAG, "RunGecko - URI = " + uri);
|
||||
Log.w(LOGTAG, "RunGecko - URI = " + mUri);
|
||||
|
||||
GeckoAppShell.runGecko(app.getApplication().getPackageResourcePath(),
|
||||
intent.getStringExtra("args"),
|
||||
uri);
|
||||
mIntent.getStringExtra("args"),
|
||||
mUri);
|
||||
} catch (Exception e) {
|
||||
Log.e(LOGTAG, "top level exception", e);
|
||||
StringWriter sw = new StringWriter();
|
||||
|
|
Загрузка…
Ссылка в новой задаче