Search in sources :

Example 1 with PendingExpenseDetailActivity

use of com.polito.mad17.madmax.activities.expenses.PendingExpenseDetailActivity in project MadMax by deviz92.

the class PendingExpenseDetailActivity method onOptionsItemSelected.

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    Intent intent;
    Log.d(TAG, "Clicked item: " + item.getItemId());
    switch(item.getItemId()) {
        case R.id.one:
            Log.d(TAG, "clicked Modify pending expense");
            intent = new Intent(this, ExpenseEdit.class);
            intent.putExtra("expenseID", expenseID);
            intent.putExtra("EXPENSE_TYPE", "PENDING_EXPENSE_EDIT");
            startActivity(intent);
            finish();
            return true;
        case R.id.two:
            Log.d(TAG, "clicked Remove pending expense");
            FirebaseUtils.getInstance().removePendingExpenseFirebase(expenseID, getApplicationContext());
            finish();
            return true;
        case android.R.id.home:
            Log.d(TAG, "Clicked up button on PendingExpenseDetailActivity");
            intent = new Intent(PendingExpenseDetailActivity.this, MainActivity.class);
            intent.putExtra("UID", MainActivity.getCurrentUID());
            intent.putExtra("currentFragment", 2);
            startActivity(intent);
            finish();
            return (true);
        default:
            return super.onOptionsItemSelected(item);
    }
}
Also used : Intent(android.content.Intent) MainActivity(com.polito.mad17.madmax.activities.MainActivity)

Aggregations

Intent (android.content.Intent)1 MainActivity (com.polito.mad17.madmax.activities.MainActivity)1