Skip to content

Instantly share code, notes, and snippets.

@BMU-Verlag
Created May 25, 2020 07:25
Show Gist options
  • Save BMU-Verlag/3587210d854e27096a143abc92a7bbff to your computer and use it in GitHub Desktop.
Save BMU-Verlag/3587210d854e27096a143abc92a7bbff to your computer and use it in GitHub Desktop.
package com.example.ersteapp;
import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
public class MainActivity extends AppCompatActivity {
public static final String AUSGABE = "com.example.ersteapp.NACHRICHT";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void begruessungAusgeben(View view) {
Intent intent = new Intent(this, Begruessung.class);
EditText editText = (EditText) findViewById(R.id.editText);
String inhalt = editText.getText().toString();
intent.putExtra(AUSGABE, inhalt);
startActivity(intent);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment