18739b58f7860d8d03916b9a529d1fd5950937626Adam Powell/*
28739b58f7860d8d03916b9a529d1fd5950937626Adam Powell * Copyright (C) 2012 The Android Open Source Project
38739b58f7860d8d03916b9a529d1fd5950937626Adam Powell *
48739b58f7860d8d03916b9a529d1fd5950937626Adam Powell * Licensed under the Apache License, Version 2.0 (the "License");
58739b58f7860d8d03916b9a529d1fd5950937626Adam Powell * you may not use this file except in compliance with the License.
68739b58f7860d8d03916b9a529d1fd5950937626Adam Powell * You may obtain a copy of the License at
78739b58f7860d8d03916b9a529d1fd5950937626Adam Powell *
88739b58f7860d8d03916b9a529d1fd5950937626Adam Powell *      http://www.apache.org/licenses/LICENSE-2.0
98739b58f7860d8d03916b9a529d1fd5950937626Adam Powell *
108739b58f7860d8d03916b9a529d1fd5950937626Adam Powell * Unless required by applicable law or agreed to in writing, software
118739b58f7860d8d03916b9a529d1fd5950937626Adam Powell * distributed under the License is distributed on an "AS IS" BASIS,
128739b58f7860d8d03916b9a529d1fd5950937626Adam Powell * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
138739b58f7860d8d03916b9a529d1fd5950937626Adam Powell * See the License for the specific language governing permissions and
148739b58f7860d8d03916b9a529d1fd5950937626Adam Powell * limitations under the License.
158739b58f7860d8d03916b9a529d1fd5950937626Adam Powell */
168739b58f7860d8d03916b9a529d1fd5950937626Adam Powell
178739b58f7860d8d03916b9a529d1fd5950937626Adam Powellpackage com.example.android.support.appnavigation.app;
188739b58f7860d8d03916b9a529d1fd5950937626Adam Powell
198739b58f7860d8d03916b9a529d1fd5950937626Adam Powellimport android.app.Activity;
208739b58f7860d8d03916b9a529d1fd5950937626Adam Powellimport android.content.Intent;
218739b58f7860d8d03916b9a529d1fd5950937626Adam Powellimport android.os.Bundle;
228739b58f7860d8d03916b9a529d1fd5950937626Adam Powellimport android.view.MenuItem;
238739b58f7860d8d03916b9a529d1fd5950937626Adam Powellimport android.view.View;
248739b58f7860d8d03916b9a529d1fd5950937626Adam Powell
25def582a5836579a3fadabfdbe4413cb1652bf098Aurimas Liutikasimport androidx.core.app.NavUtils;
26def582a5836579a3fadabfdbe4413cb1652bf098Aurimas Liutikas
27def582a5836579a3fadabfdbe4413cb1652bf098Aurimas Liutikasimport com.example.android.support.appnavigation.R;
28def582a5836579a3fadabfdbe4413cb1652bf098Aurimas Liutikas
298739b58f7860d8d03916b9a529d1fd5950937626Adam Powellpublic class ContentCategoryActivity extends Activity {
308739b58f7860d8d03916b9a529d1fd5950937626Adam Powell    @Override
318739b58f7860d8d03916b9a529d1fd5950937626Adam Powell    protected void onCreate(Bundle savedInstanceState) {
328739b58f7860d8d03916b9a529d1fd5950937626Adam Powell        super.onCreate(savedInstanceState);
338739b58f7860d8d03916b9a529d1fd5950937626Adam Powell        setContentView(R.layout.content_category);
348739b58f7860d8d03916b9a529d1fd5950937626Adam Powell
358739b58f7860d8d03916b9a529d1fd5950937626Adam Powell        ActionBarCompat.setDisplayHomeAsUpEnabled(this, true);
368739b58f7860d8d03916b9a529d1fd5950937626Adam Powell    }
378739b58f7860d8d03916b9a529d1fd5950937626Adam Powell
388739b58f7860d8d03916b9a529d1fd5950937626Adam Powell    @Override
398739b58f7860d8d03916b9a529d1fd5950937626Adam Powell    public boolean onOptionsItemSelected(MenuItem item) {
408739b58f7860d8d03916b9a529d1fd5950937626Adam Powell        if (item.getItemId() == android.R.id.home) {
418739b58f7860d8d03916b9a529d1fd5950937626Adam Powell            NavUtils.navigateUpFromSameTask(this);
428739b58f7860d8d03916b9a529d1fd5950937626Adam Powell            return true;
438739b58f7860d8d03916b9a529d1fd5950937626Adam Powell        }
448739b58f7860d8d03916b9a529d1fd5950937626Adam Powell        return super.onOptionsItemSelected(item);
458739b58f7860d8d03916b9a529d1fd5950937626Adam Powell    }
468739b58f7860d8d03916b9a529d1fd5950937626Adam Powell
478739b58f7860d8d03916b9a529d1fd5950937626Adam Powell    public void onViewContent(View v) {
488739b58f7860d8d03916b9a529d1fd5950937626Adam Powell        Intent target = new Intent(this, ContentViewActivity.class);
498739b58f7860d8d03916b9a529d1fd5950937626Adam Powell        startActivity(target);
508739b58f7860d8d03916b9a529d1fd5950937626Adam Powell    }
518739b58f7860d8d03916b9a529d1fd5950937626Adam Powell}
52