Skip to content
This repository was archived by the owner on Jun 23, 2022. It is now read-only.

Commit fd12441

Browse files
sdspikesLyla
authored andcommitted
3.06 Launch the settings activity when the settings menu item is selected
1 parent 296319f commit fd12441

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

app/src/main/java/com/example/android/sunshine/app/DetailActivity.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
5757

5858
//noinspection SimplifiableIfStatement
5959
if (id == R.id.action_settings) {
60+
startActivity(new Intent(this, SettingsActivity.class));
6061
return true;
6162
}
6263

app/src/main/java/com/example/android/sunshine/app/MainActivity.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package com.example.android.sunshine.app;
1717

18+
import android.content.Intent;
1819
import android.os.Bundle;
1920
import android.support.v7.app.ActionBarActivity;
2021
import android.view.Menu;
@@ -49,6 +50,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
4950

5051
//noinspection SimplifiableIfStatement
5152
if (id == R.id.action_settings) {
53+
startActivity(new Intent(this, SettingsActivity.class));
5254
return true;
5355
}
5456

0 commit comments

Comments
 (0)