blob: 0dbc14893e23484a12b355062d27cec408932807 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2013, 2017 Orange.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* Contributors:
* BAREAU Cyrille <cyrille.bareau@orange.com>,
* BONNARDEL Gregory <gbonnardel.ext@orange.com>,
* BOLLE Sebastien <sebastien.bolle@orange.com>.
*******************************************************************************/
package org.eclipse.om2m.android.dashboard;
import org.eclipse.om2m.android.dashboard.R;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
public class CustomSecondaryActivity extends Activity {
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_secondary, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch(item.getItemId()) {
case R.id.menu_help:
// to be overridden
break;
case android.R.id.home:
Intent mainActivity = new Intent(CustomSecondaryActivity.this, DashboardActivity.class);
mainActivity.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(mainActivity);
break;
default:
break;
}
return true;
}
}