]> gitweb.stoutner.com Git - PrivacyBrowserAndroid.git/blobdiff - app/src/main/java/com/stoutner/privacybrowser/dialogs/AddDomainDialog.java
Add a requests activity. https://redmine.stoutner.com/issues/170
[PrivacyBrowserAndroid.git] / app / src / main / java / com / stoutner / privacybrowser / dialogs / AddDomainDialog.java
index c67c3aedf8e766abaf27780bf48093e4b293fcf5..edffc63fb8b3d069ce2f08818ee1daac19c4af21 100644 (file)
@@ -53,14 +53,11 @@ public class AddDomainDialog extends AppCompatDialogFragment {
 
 
     public void onAttach(Context context) {
+        // Run the default commands.
         super.onAttach(context);
 
-        // Get a handle for `AddDomainListener` from `context`.
-        try {
-            addDomainListener = (AddDomainListener) context;
-        } catch(ClassCastException exception) {
-            throw new ClassCastException(context.toString() + " must implement `AddDomainListener`.");
-        }
+        // Get a handle for the listener from the launching context.
+        addDomainListener = (AddDomainListener) context;
     }
 
     // `@SuppressLing("InflateParams")` removes the warning about using `null` as the parent view group when inflating the `AlertDialog`.