Browse Source

Mikrofon als Activity

Mikrofon
Julia Prölß 1 year ago
parent
commit
5b920359a1

+ 1
- 0
app/src/main/AndroidManifest.xml View File

@@ -2,6 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.greenwatch">

<uses-permission android:name="android.permission.RECORD_AUDIO" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"

+ 11
- 0
app/src/main/java/com/example/greenwatch/MainActivity.java View File

@@ -2,7 +2,10 @@ package com.example.greenwatch;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

@@ -10,5 +13,13 @@ public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

((Button)findViewById(R.id.buttonstartmicdetection)).setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View view) {
Intent i = new Intent(MainActivity.this, Mikrofon.class);
startActivity(i);
}
});
}
}

+ 0
- 4
app/src/main/java/com/example/greenwatch/Mikrofon.java View File

@@ -1,4 +0,0 @@
package com.example.greenwatch;

public class Mikrofon {
}

+ 5
- 5
app/src/main/res/layout/activity_main.xml View File

@@ -6,13 +6,13 @@
android:layout_height="match_parent"
tools:context=".MainActivity">

<TextView
<Button
android:id="@+id/buttonstartmicdetection"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
android:text="Starte Mikrofon Detection"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

Loading…
Cancel
Save