1 /*
2  * Copyright (C) 2013 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.photos;
18 
19 import android.app.Activity;
20 import android.os.Bundle;
21 
22 public class AlbumActivity extends Activity implements MultiChoiceManager.Provider {
23 
24     public static final String KEY_ALBUM_URI = AlbumFragment.KEY_ALBUM_URI;
25     public static final String KEY_ALBUM_TITLE = AlbumFragment.KEY_ALBUM_TITLE;
26 
27     private MultiChoiceManager mMultiChoiceManager;
28 
29     @Override
onCreate(Bundle savedInstanceState)30     protected void onCreate(Bundle savedInstanceState) {
31         super.onCreate(savedInstanceState);
32         Bundle intentExtras = getIntent().getExtras();
33         mMultiChoiceManager = new MultiChoiceManager(this);
34         if (savedInstanceState == null) {
35             AlbumFragment albumFragment = new AlbumFragment();
36             mMultiChoiceManager.setDelegate(albumFragment);
37             albumFragment.setArguments(intentExtras);
38             getFragmentManager().beginTransaction().add(android.R.id.content,
39                     albumFragment).commit();
40         }
41         getActionBar().setTitle(intentExtras.getString(KEY_ALBUM_TITLE));
42     }
43 
44     @Override
getMultiChoiceManager()45     public MultiChoiceManager getMultiChoiceManager() {
46         return mMultiChoiceManager;
47     }
48 }
49