|
1 | 1 | package com.github.andlyticsproject.about;
|
2 | 2 |
|
3 |
| -import android.app.ActionBar; |
4 |
| -import android.app.ActionBar.Tab; |
5 |
| -import android.app.Activity; |
6 |
| -import android.app.FragmentTransaction; |
| 3 | +import android.support.v7.app.ActionBar; |
| 4 | +import android.support.v7.app.ActionBar.Tab; |
| 5 | +import android.support.v7.app.AppCompatActivity; |
| 6 | +import android.support.v4.app.FragmentTransaction; |
7 | 7 | import android.content.Intent;
|
8 | 8 | import android.net.Uri;
|
9 | 9 | import android.os.Bundle;
|
|
13 | 13 |
|
14 | 14 | import com.github.andlyticsproject.R;
|
15 | 15 |
|
16 |
| -public class AboutActivity extends Activity implements |
| 16 | +public class AboutActivity extends AppCompatActivity implements |
17 | 17 | ActionBar.TabListener {
|
18 | 18 | private static final String BUNDLE_KEY_TABINDEX = "tabindex";
|
19 | 19 |
|
20 | 20 | @Override
|
21 | 21 | public void onCreate(Bundle savedInstanceState) {
|
22 | 22 | super.onCreate(savedInstanceState);
|
23 |
| - getActionBar().setDisplayHomeAsUpEnabled(true); |
24 | 23 |
|
25 | 24 | setContentView(R.layout.about_navigation);
|
26 | 25 |
|
27 |
| - getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); |
28 |
| - ActionBar.Tab tab1 = getActionBar().newTab(); |
| 26 | + getSupportActionBar().setDisplayHomeAsUpEnabled(true); |
| 27 | + getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); |
| 28 | + Tab tab1 = getSupportActionBar().newTab(); |
29 | 29 | tab1.setText(R.string.about_credits);
|
30 | 30 | tab1.setTabListener(this);
|
31 | 31 |
|
32 |
| - ActionBar.Tab tab2 = getActionBar().newTab(); |
| 32 | + Tab tab2 = getSupportActionBar().newTab(); |
33 | 33 | tab2.setText(R.string.changelog_title);
|
34 | 34 | tab2.setTabListener(this);
|
35 | 35 |
|
36 |
| - getActionBar().addTab(tab1); |
37 |
| - getActionBar().addTab(tab2); |
| 36 | + getSupportActionBar().addTab(tab1); |
| 37 | + getSupportActionBar().addTab(tab2); |
38 | 38 | }
|
39 | 39 |
|
40 | 40 | @Override
|
41 | 41 | public void onSaveInstanceState(Bundle savedInstanceState) {
|
42 | 42 | super.onSaveInstanceState(savedInstanceState);
|
43 |
| - savedInstanceState.putInt(BUNDLE_KEY_TABINDEX, getActionBar() |
| 43 | + savedInstanceState.putInt(BUNDLE_KEY_TABINDEX, getSupportActionBar() |
44 | 44 | .getSelectedTab().getPosition());
|
45 | 45 | }
|
46 | 46 |
|
47 | 47 | @Override
|
48 | 48 | public void onRestoreInstanceState(Bundle savedInstanceState) {
|
49 | 49 | super.onRestoreInstanceState(savedInstanceState);
|
50 |
| - getActionBar().setSelectedNavigationItem( |
| 50 | + getSupportActionBar().setSelectedNavigationItem( |
51 | 51 | savedInstanceState.getInt(BUNDLE_KEY_TABINDEX));
|
52 | 52 | }
|
53 | 53 |
|
|
0 commit comments