add some navigation between activities

This commit is contained in:
tibbi 2016-07-19 00:11:10 +02:00
parent 047ef895c1
commit b96ab2c3c4
3 changed files with 21 additions and 4 deletions

View File

@ -31,19 +31,23 @@
<activity
android:name=".activities.AboutActivity"
android:label="@string/about"/>
android:label="@string/about"
android:parentActivityName=".activities.MainActivity"/>
<activity
android:name=".activities.DayActivity"
android:label="@string/details"/>
android:label="@string/details"
android:parentActivityName=".activities.MainActivity"/>
<activity
android:name=".activities.EventActivity"
android:label="@string/event"/>
android:label="@string/event"
android:parentActivityName=".activities.DayActivity"/>
<activity
android:name=".activities.LicenseActivity"
android:label="@string/third_party_licences"/>
android:label="@string/third_party_licences"
android:parentActivityName=".activities.AboutActivity"/>
<activity
android:name=".activities.SettingsActivity"

View File

@ -124,6 +124,7 @@ public class DayActivity extends SimpleActivity
datePicker.init(dateTime.getYear(), dateTime.getMonthOfYear() - 1, dateTime.getDayOfMonth(), null);
alertDialog.setView(view);
alertDialog.setNegativeButton("Cancel", null);
alertDialog.setPositiveButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
final int month = datePicker.getMonth() + 1;

View File

@ -3,6 +3,7 @@ package com.simplemobiletools.calendar.activities;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.MenuItem;
import com.simplemobiletools.calendar.Config;
import com.simplemobiletools.calendar.R;
@ -16,4 +17,15 @@ public class SimpleActivity extends AppCompatActivity {
setTheme(mConfig.getIsDarkTheme() ? R.style.AppTheme_Dark : R.style.AppTheme);
super.onCreate(savedInstanceState);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}