Added reactive versions of Activities and Fragments

Subclasses of the common `Activity` and `Fragment` classes, extended so you can easily get an `Observable<LifecycleEvent>`.

I wanted to get the ball rolling on this discussion (since it's the second part of #12, as I viewed it). I am fully aware this may be a controversial move. :P

I tried working up [a version](https://gist.github.com/dlew/33b650bd8ef3d360ff7d) using `ActivityLifecycleCallbacks`, but it felt too weird to have one solution for `Activity` and another for `Fragment`. Also, watching #84 has caused me to realize there are multiple places where being able to hook into the `Activity` or `Fragment` directly will save a lot of boilerplate.

I purposefully chose to not rename the subclasses. That way, when you extend, say, `Activity` the package resolution dialog will show this version as well.

One conspicuously missing extension is `ActionBarActivity`, since it depends on #83.
Try removing the unsubscribe. The activity will leak. At least it did last
time I tested the sample.

On Sat, Nov 29, 2014, 10:26 Roman Mazur <notifications@github.com> wrote:

> In
> sample-app/src/main/java/rx/android/samples/LifecycleObservableActivity.java:
>
> > +
> > +    @Override
> > +    protected void onCreate(Bundle savedInstanceState) {
> > +        super.onCreate(savedInstanceState);
> > +
> > +        button = new Button(this);
> > +        button.setText("Click Me!");
> > +        setContentView(button);
> > +    }
> > +
> > +    @Override
> > +    protected void onStart() {
> > +        super.onStart();
> > +
> > +        subscription =
> > +                LifecycleObservable.bindActivityLifecycle(lifecycle(), ViewObservable.clicks(button))
>
> I'm not speaking about necessity of click observable. But whether it is
> necessary to unsubscribe in this case. Unsubscription in this case leads to
> remove of click listener. And I personally rarely need to do it in onStop
> or in onDestroy.
> … <#msg-f:1486120348025889653_>
> On 14:57, Sat, Nov 29, 2014 Daniel Lew <notifications@github.com> wrote:
> In
> sample-app/src/main/java/rx/android/samples/LifecycleObservableActivity.java:
> > + > + @Override <https://github.com/Override> > + protected void
> onCreate(Bundle savedInstanceState) { > + super.onCreate(
> savedInstanceState); > + > + button = new Button(this); > +
> button.setText("Click Me!"); > + setContentView(button); > + } > + > +
> @Override <https://github.com/Override> > + protected void onStart() { >
> + super.onStart(); > + > + subscription = > +
> LifecycleObservable.bindActivityLifecycle(lifecycle(),
> ViewObservable.clicks(button)) If no one ever had use for binding a click
> listener in practice, why do we bother having ViewObservable.clicks()? —
> Reply to this email directly or view it on GitHub <
> https://github.com/ReactiveX/RxAndroid/pull/93/files#r21053708>.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/ReactiveX/RxAndroid/pull/93/files#r21054500>.
>