private void ProcessURLCallback(String url) { AccessObject AccessAux = LoginInterface.GetAccessToken(url); // Captura el access Token si esta en la url if (AccessAux != null) { PreferencesManager.SavePreferences_Access(AccessAux, this.getApplicationContext()); Access = AccessAux; GoToPanel(); } }
/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // GoToPanel(); Access = PreferencesManager.LoadPreferences_Access(this.getApplicationContext()); if (!Access.IsValid()) // No tenemos un token valido, lo necesitamos { browser = (WebView) findViewById(R.id.webview); browser.getSettings().setJavaScriptEnabled(true); browser.addJavascriptInterface(this, "jsNativeInterface"); browser.loadUrl(LoginInterface.DialogURL); browser.clearCache(true); browser.setWebViewClient( new LoginViewClient()); // Evita que se abra un navegador cuando se produce la carga de // otra url } else { GoToPanel(); } }