マップ生成のボタン

This commit is contained in:
it232115 2024-06-04 14:39:11 +09:00
parent a5ab646f29
commit 9d385dd87a
2 changed files with 6 additions and 16 deletions

View File

@ -19,20 +19,10 @@ public class MainActivity extends AppCompatActivity implements View.OnClickListe
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main); setContentView(R.layout.activity_main);
findViewById(R.id.mapmapcreate).setOnClickListener(
button = findViewById(R.id.button1); view->{
button.setOnClickListener(this);
editText = findViewById(R.id.textview1);
} }
);
@Override
public void onClick(View v) {
if (v == button){
editText.setText("押した");
}
} }
} }

View File

@ -8,8 +8,8 @@
android:orientation="vertical"> android:orientation="vertical">
<Button <Button
android:id="@+id/button1" android:id="@+id/mapmapcreate"
android:text="押せよ" android:text="マップ生成"
android:textSize="50px" android:textSize="50px"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"