Fixed crash when opening browser from intent
This commit is contained in:
parent
8b44ce12fa
commit
da4985d4de
@ -1,7 +1,6 @@
|
|||||||
package acr.browser.lightning.utils;
|
package acr.browser.lightning.utils;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.support.v7.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
@ -14,6 +14,7 @@ import acr.browser.lightning.fragment.TabsFragment;
|
|||||||
import acr.browser.lightning.object.SearchAdapter;
|
import acr.browser.lightning.object.SearchAdapter;
|
||||||
import acr.browser.lightning.utils.ProxyUtils;
|
import acr.browser.lightning.utils.ProxyUtils;
|
||||||
import acr.browser.lightning.view.LightningView;
|
import acr.browser.lightning.view.LightningView;
|
||||||
|
import acr.browser.lightning.view.LightningWebClient;
|
||||||
import dagger.Component;
|
import dagger.Component;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
@ -46,4 +47,6 @@ public interface AppComponent {
|
|||||||
|
|
||||||
void inject(ReadingActivity activity);
|
void inject(ReadingActivity activity);
|
||||||
|
|
||||||
|
void inject(LightningWebClient webClient);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -44,7 +44,7 @@ import acr.browser.lightning.utils.IntentUtils;
|
|||||||
import acr.browser.lightning.utils.ProxyUtils;
|
import acr.browser.lightning.utils.ProxyUtils;
|
||||||
import acr.browser.lightning.utils.Utils;
|
import acr.browser.lightning.utils.Utils;
|
||||||
|
|
||||||
class LightningWebClient extends WebViewClient {
|
public class LightningWebClient extends WebViewClient {
|
||||||
|
|
||||||
|
|
||||||
private final Activity mActivity;
|
private final Activity mActivity;
|
||||||
@ -54,10 +54,10 @@ class LightningWebClient extends WebViewClient {
|
|||||||
private final Bus mEventBus;
|
private final Bus mEventBus;
|
||||||
private final IntentUtils mIntentUtils;
|
private final IntentUtils mIntentUtils;
|
||||||
|
|
||||||
@Inject
|
@Inject ProxyUtils mProxyUtils;
|
||||||
ProxyUtils mProxyUtils;
|
|
||||||
|
|
||||||
LightningWebClient(Activity activity, LightningView lightningView) {
|
LightningWebClient(Activity activity, LightningView lightningView) {
|
||||||
|
BrowserApp.getAppComponent().inject(this);
|
||||||
mActivity = activity;
|
mActivity = activity;
|
||||||
mUIController = (UIController) activity;
|
mUIController = (UIController) activity;
|
||||||
mLightningView = lightningView;
|
mLightningView = lightningView;
|
||||||
|
Loading…
Reference in New Issue
Block a user