ManagedActivity.java 2.33 KB
Newer Older
Alexander Ivanov's avatar
Alexander Ivanov committed
1 2
/**
 * Copyright (c) 2013, Redsolution LTD. All rights reserved.
3
 *
Alexander Ivanov's avatar
Alexander Ivanov committed
4 5
 * This file is part of Xabber project; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License, Version 3.
6
 *
Alexander Ivanov's avatar
Alexander Ivanov committed
7 8 9 10
 * Xabber is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
11
 *
Alexander Ivanov's avatar
Alexander Ivanov committed
12 13 14
 * You should have received a copy of the GNU General Public License,
 * along with this program. If not, see http://www.gnu.org/licenses/.
 */
15 16 17 18
package com.xabber.android.ui.helper;

import android.content.Intent;
import android.os.Bundle;
19
import android.support.v7.app.ActionBarActivity;
20 21 22 23 24

import com.xabber.android.data.ActivityManager;

/**
 * Base class for all Activities.
25
 * <p/>
26
 * Adds custom activity logic.
27
 *
28 29
 * @author alexander.ivanov
 */
30
public abstract class ManagedActivity extends ActionBarActivity {
31

32 33 34 35 36
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        ActivityManager.getInstance().onCreate(this);
        super.onCreate(savedInstanceState);
    }
37

38 39 40 41 42
    @Override
    protected void onResume() {
        ActivityManager.getInstance().onResume(this);
        super.onResume();
    }
43

44 45 46 47 48
    @Override
    protected void onPause() {
        ActivityManager.getInstance().onPause(this);
        super.onPause();
    }
49

50 51 52 53 54
    @Override
    protected void onDestroy() {
        ActivityManager.getInstance().onDestroy(this);
        super.onDestroy();
    }
55

56 57 58 59 60
    @Override
    protected void onNewIntent(Intent intent) {
        ActivityManager.getInstance().onNewIntent(this, intent);
        super.onNewIntent(intent);
    }
61

62 63 64 65 66 67
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        ActivityManager.getInstance().onActivityResult(this, requestCode,
                resultCode, data);
        super.onActivityResult(requestCode, resultCode, data);
    }
68

69 70 71 72 73
    @Override
    public void startActivity(Intent intent) {
        ActivityManager.getInstance().updateIntent(this, intent);
        super.startActivity(intent);
    }
74

75 76 77 78 79
    @Override
    public void startActivityForResult(Intent intent, int requestCode) {
        ActivityManager.getInstance().updateIntent(this, intent);
        super.startActivityForResult(intent, requestCode);
    }
80 81

}