import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
+import androidx.annotation.NonNull;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.Toolbar; // The AndroidX toolbar must be used until the minimum API is >= 21.
}
// Get the source using an AsyncTask if the URL begins with `http`.
- if (currentUrl.startsWith("http")) {
+ if ((currentUrl != null) && currentUrl.startsWith("http")) {
new GetSource(this, userAgent).execute(currentUrl);
}
}
}
@Override
- public boolean onOptionsItemSelected(MenuItem menuItem) {
+ public boolean onOptionsItemSelected(@NonNull MenuItem menuItem) {
// Get a handle for the about alert dialog.
DialogFragment aboutDialogFragment = new AboutViewSourceDialog();