<Main Activity>
package
kkk.questionnare
import
androidx.appcompat.app.AppCompatActivity
import
android.os.Bundle
import
android.widget.Toast
class
MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super
.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
}
public
<span style=
"color:#FF0000"
><span style=
"text-decoration: underline;"
>
void
btn1(View v) {</span>
<span style=
"text-decoration: underline;"
>Toast.makeText(
this
,
"버튼 클릭 완료"
, Toast.LENGTH_SHORT).show();
}</span>
</span>
}
<Layout>
<?xml version=
"1.0"
encoding=
"utf-8"
?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=
"<a href="
http:
xmlns:app=
"<a href="
http:
xmlns:tools=
"<a href="
http:
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
tools:context=
".MainActivity"
>
<Button
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"92dp"
android:layout_marginBottom=
"579dp"
android:text=
"버튼"
android:textSize=
"30dp"
tools:ignore=
"MissingConstraints"
android:onClick=
"btn1"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"1.0"
tools:layout_editor_absoluteX=
"159dp"
/>
</androidx.constraintlayout.widget.ConstraintLayout>