Sunny Goyal | 1d0b093 | 2015-03-20 18:51:38 -0700 | [diff] [blame^] | 1 | package com.android.launcher3.base; |
| 2 | |
| 3 | import android.app.Activity; |
| 4 | import android.content.Context; |
| 5 | |
| 6 | /** |
| 7 | * A wrapper over {@link Activity} which allows to override some methods. |
| 8 | * The base implementation can change from an Activity to a Fragment (or any other custom |
| 9 | * implementation), Callers should not assume that the base class extends Context, instead use |
| 10 | * either {@link #getContext} or {@link #getActivity} |
| 11 | */ |
| 12 | public class BaseActivity extends Activity { |
| 13 | |
| 14 | public Context getContext() { |
| 15 | return this; |
| 16 | } |
| 17 | |
| 18 | public Activity getActivity() { |
| 19 | return this; |
| 20 | } |
| 21 | } |