Improve formatting

This commit is contained in:
Stypox 2020-01-30 21:05:57 +01:00
parent 4e1638f86e
commit fe138f6d61
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
1 changed files with 3 additions and 4 deletions

View File

@ -51,18 +51,17 @@ public class ReCaptchaActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_recaptcha); setContentView(R.layout.activity_recaptcha);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
String url = getIntent().getStringExtra(RECAPTCHA_URL_EXTRA); String url = getIntent().getStringExtra(RECAPTCHA_URL_EXTRA);
if (url == null || url.isEmpty()) { if (url == null || url.isEmpty()) {
url = YT_URL; url = YT_URL;
} }
// Set return to Cancel by default // Set return to Cancel by default
setResult(RESULT_CANCELED); setResult(RESULT_CANCELED);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
WebView myWebView = findViewById(R.id.reCaptchaWebView); WebView myWebView = findViewById(R.id.reCaptchaWebView);
@ -81,7 +80,7 @@ public class ReCaptchaActivity extends AppCompatActivity {
// Cleaning cache, history and cookies from webView // Cleaning cache, history and cookies from webView
myWebView.clearCache(true); myWebView.clearCache(true);
myWebView.clearHistory(); myWebView.clearHistory();
android.webkit.CookieManager cookieManager = CookieManager .getInstance(); android.webkit.CookieManager cookieManager = CookieManager.getInstance();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
cookieManager.removeAllCookies(aBoolean -> {}); cookieManager.removeAllCookies(aBoolean -> {});
} else { } else {