Created
May 13, 2018 04:17
-
-
Save adrianhall/0e525149882ecd9618f33202eba29314 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
package com.shellmonger.apps.mynotes.ui | |
import android.support.v7.app.AppCompatActivity | |
import android.os.Bundle | |
import android.util.Log | |
import com.shellmonger.apps.mynotes.R | |
class NoteDetailActivity : AppCompatActivity() { | |
companion object { | |
private val TAG = this::class.java.simpleName | |
} | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_note_detail) | |
loadFragment("temp-note") | |
} | |
private fun loadFragment(noteId: String) { | |
Log.d(TAG, "Loading fragment for note $noteId") | |
val fragment = NoteDetailFragment().apply { | |
arguments = Bundle().apply { putString(NoteDetailFragment.ARG_NOTE, noteId) } | |
} | |
supportFragmentManager | |
?.beginTransaction() | |
?.add(R.id.note_detail_fragment, fragment) | |
?.commit() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment