I need to reference an activity in several static methods. I'm curious to know the best practices to avoid memory leaks. Let's use examples:

Example 1:

```java
static void hideKeyboard(Activity activity) {
   WeakReference<Activity> activityReference = new WeakReference<>(activity);
   // ... Call activityReference.get() when needed, check if null...
}

```

Example 2:

```java
static void hideKeyboard(WeakReference<Activity> activityReference) {
   // ... Call activityReference.get() when needed, check if null...
}

```

So three questions:

1. Do example 1 or 2 make any difference?
2. I haven't seen methods being called this way much outside of subclasses of `Thread` or `AsyncTask`. Any reason why? Am I missing something?
3. If the weak reference is used in a `Thread` or `AsyncTask` inside one of those methods, could memory still leak?