Skip to content

Instantly share code, notes, and snippets.

@shingohry
Last active January 7, 2019 07:42
Show Gist options
  • Save shingohry/ba911adbc6ca601e476b48396c7b189e to your computer and use it in GitHub Desktop.
Save shingohry/ba911adbc6ca601e476b48396c7b189e to your computer and use it in GitHub Desktop.
ResultActivity
package com.example.myfirstapp
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.widget.TextView
class ResultActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_result)
// ----- 以下を追加する -----
// パラメータを取得する
val message = intent.getStringExtra("message")
// TextViewへの参照を取得する
val textView = findViewById<TextView>(R.id.textView)
// TextViewにテキストを設定する
textView.text = message
// ------------------------
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment