-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
P2022 177/navigate to details screen (#13)
* Adds navigation to DetailsActivity from MainActivity using temporary image icon in header. * Adds DetailsActivity to the manifest as it was missing.
- Loading branch information
1 parent
421ec61
commit 5548e83
Showing
2 changed files
with
15 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
12 changes: 11 additions & 1 deletion
12
app/src/main/java/com/intive/patronage22/intivi/MainActivity.kt
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 |
---|---|---|
@@ -1,11 +1,21 @@ | ||
package com.intive.patronage22.intivi | ||
|
||
import androidx.appcompat.app.AppCompatActivity | ||
import android.content.Intent | ||
import android.os.Bundle | ||
import android.view.View | ||
import android.widget.ImageView | ||
import androidx.appcompat.app.AppCompatActivity | ||
|
||
class MainActivity : AppCompatActivity() { | ||
override fun onCreate(savedInstanceState: Bundle?) { | ||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_main) | ||
clickNavigate(findViewById<ImageView>(R.id.imageView), DetailsActivity::class.java) | ||
} | ||
|
||
private fun clickNavigate(view: View, activity: Class<*>){ | ||
view.setOnClickListener{ | ||
startActivity(Intent(this, activity)) | ||
} | ||
} | ||
} |