Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
192 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
package com.example; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import android.content.Intent; | ||
import android.os.Bundle; | ||
import android.util.Log; | ||
import android.view.View; | ||
import android.widget.Button; | ||
|
||
public class Lesson4Activity extends AppCompatActivity { | ||
private final String TAG = "DEBUG_" + Lesson4Activity.class.getSimpleName(); | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
Log.d(TAG, "onCreate"); | ||
setContentView(R.layout.activity_lesson4); | ||
|
||
// Viewを取得 | ||
Button button = findViewById(R.id.lesson4_button); | ||
button.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
Intent intent = new Intent(getApplicationContext(), Lesson4SubActivity.class); | ||
startActivity(intent); | ||
} | ||
}); | ||
} | ||
|
||
@Override | ||
protected void onStart() { | ||
super.onStart(); | ||
Log.d(TAG, "onStart"); | ||
} | ||
|
||
@Override | ||
protected void onRestart() { | ||
super.onRestart(); | ||
Log.d(TAG, "onRestart"); | ||
} | ||
|
||
@Override | ||
protected void onResume() { | ||
super.onResume(); | ||
Log.d(TAG, "onResume"); | ||
} | ||
|
||
@Override | ||
protected void onPause() { | ||
super.onPause(); | ||
Log.d(TAG, "onPause"); | ||
} | ||
|
||
@Override | ||
protected void onStop() { | ||
super.onStop(); | ||
Log.d(TAG, "onStop"); | ||
} | ||
|
||
@Override | ||
protected void onDestroy() { | ||
super.onDestroy(); | ||
Log.d(TAG, "onDestroy"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package com.example; | ||
|
||
import androidx.appcompat.app.AppCompatActivity; | ||
|
||
import android.os.Bundle; | ||
import android.util.Log; | ||
import android.view.View; | ||
import android.widget.Button; | ||
|
||
public class Lesson4SubActivity extends AppCompatActivity { | ||
private final String TAG = "DEBUG_" + Lesson4SubActivity.class.getSimpleName(); | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
Log.d(TAG, "onCreate"); | ||
setContentView(R.layout.activity_lesson4_sub); | ||
|
||
// Viewを取得 | ||
Button button = findViewById(R.id.lesson4_sub_button); | ||
button.setOnClickListener(new View.OnClickListener() { | ||
@Override | ||
public void onClick(View v) { | ||
finish(); | ||
} | ||
}); | ||
} | ||
|
||
@Override | ||
protected void onStart() { | ||
super.onStart(); | ||
Log.d(TAG, "onStart"); | ||
} | ||
|
||
@Override | ||
protected void onRestart() { | ||
super.onRestart(); | ||
Log.d(TAG, "onRestart"); | ||
} | ||
|
||
@Override | ||
protected void onResume() { | ||
super.onResume(); | ||
Log.d(TAG, "onResume"); | ||
} | ||
|
||
@Override | ||
protected void onPause() { | ||
super.onPause(); | ||
Log.d(TAG, "onPause"); | ||
} | ||
|
||
@Override | ||
protected void onStop() { | ||
super.onStop(); | ||
Log.d(TAG, "onStop"); | ||
} | ||
|
||
@Override | ||
protected void onDestroy() { | ||
super.onDestroy(); | ||
Log.d(TAG, "onDestroy"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".Lesson4Activity"> | ||
|
||
<TextView | ||
android:id="@+id/lesson4_text_view" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/lesson4_text" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<Button | ||
android:id="@+id/lesson4_button" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Button" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/lesson4_text_view" /> | ||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".Lesson4SubActivity"> | ||
|
||
<TextView | ||
android:id="@+id/lesson4_sub_text_view" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="@string/lesson4_sub_text" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<Button | ||
android:id="@+id/lesson4_sub_button" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Button" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toBottomOf="@+id/lesson4_sub_text_view" /> | ||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters