SoundButton stopp

  • 66 Antworten
  • Letztes Antwortdatum
Ne klappt leider immer noch nicht :(


Log:

Code:
04-11 16:56:37.162: I/dalvikvm(1166): threadid=3: reacting to signal 3
04-11 16:56:37.351: I/dalvikvm(1166): Wrote stack traces to '/data/anr/traces.txt'
04-11 16:56:37.641: I/dalvikvm(1166): threadid=3: reacting to signal 3
04-11 16:56:37.701: I/dalvikvm(1166): Wrote stack traces to '/data/anr/traces.txt'
04-11 16:56:37.971: D/gralloc_goldfish(1166): Emulator without GPU emulation detected.
04-11 16:57:32.261: D/AndroidRuntime(1166): Shutting down VM
04-11 16:57:32.261: W/dalvikvm(1166): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
04-11 16:57:32.301: E/AndroidRuntime(1166): FATAL EXCEPTION: main
04-11 16:57:32.301: E/AndroidRuntime(1166): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jannik.bestcarmotorsounds/com.jannik.bestcarmotorsounds.Audir81Activity}: java.lang.NullPointerException
04-11 16:57:32.301: E/AndroidRuntime(1166): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
04-11 16:57:32.301: E/AndroidRuntime(1166): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
04-11 16:57:32.301: E/AndroidRuntime(1166): 	at android.app.ActivityThread.access$600(ActivityThread.java:123)
04-11 16:57:32.301: E/AndroidRuntime(1166): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
04-11 16:57:32.301: E/AndroidRuntime(1166): 	at android.os.Handler.dispatchMessage(Handler.java:99)
04-11 16:57:32.301: E/AndroidRuntime(1166): 	at android.os.Looper.loop(Looper.java:137)
04-11 16:57:32.301: E/AndroidRuntime(1166): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
04-11 16:57:32.301: E/AndroidRuntime(1166): 	at java.lang.reflect.Method.invokeNative(Native Method)
04-11 16:57:32.301: E/AndroidRuntime(1166): 	at java.lang.reflect.Method.invoke(Method.java:511)
04-11 16:57:32.301: E/AndroidRuntime(1166): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-11 16:57:32.301: E/AndroidRuntime(1166): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-11 16:57:32.301: E/AndroidRuntime(1166): 	at dalvik.system.NativeStart.main(Native Method)
04-11 16:57:32.301: E/AndroidRuntime(1166): Caused by: java.lang.NullPointerException
04-11 16:57:32.301: E/AndroidRuntime(1166): 	at com.jannik.bestcarmotorsounds.Audir81Activity.onCreate(Audir81Activity.java:29)
04-11 16:57:32.301: E/AndroidRuntime(1166): 	at android.app.Activity.performCreate(Activity.java:4465)
04-11 16:57:32.301: E/AndroidRuntime(1166): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
04-11 16:57:32.301: E/AndroidRuntime(1166): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
04-11 16:57:32.301: E/AndroidRuntime(1166): 	... 11 more
04-11 16:57:32.371: I/dalvikvm(1166): threadid=3: reacting to signal 3
04-11 16:57:32.421: I/dalvikvm(1166): Wrote stack traces to '/data/anr/traces.txt'
04-11 16:57:32.901: I/dalvikvm(1166): threadid=3: reacting to signal 3
04-11 16:57:32.961: I/dalvikvm(1166): Wrote stack traces to '/data/anr/traces.txt'
04-11 16:57:33.081: I/dalvikvm(1166): threadid=3: reacting to signal 3
04-11 16:57:33.121: I/dalvikvm(1166): Wrote stack traces to '/data/anr/traces.txt'

Wieder unerwartet gestoppt.
 
[/COLOR]Du hast in der Zeile 29 ne NullPointerException in der Audir81Activity. Klammer mal den ganzen onClick kram mit /* */ aus.

Code:
/*audi1.setOnClickListener (new OnClickListener() {
			public void onClick (View v) {
				if(buttonPlay == 0){
					mp = MediaPlayer.create(getApplicationContext(), R.raw.audir8);
					buttonPlay = 1;
					startStopSound();
				}
				else if(buttonPlay == 1){
					startStopSound();
				}
				else {
					startStopSound();
					mp = MediaPlayer.create(getApplicationContext(), R.raw.audir8);
					buttonPlay = 1;
					startStopSound();
				}
			}
		});*/

Ich denke dann sollte die Activity starten. Falls ja klammer mal so aus.

Code:
/*if(buttonPlay == 0){
					mp = MediaPlayer.create(getApplicationContext(), R.raw.audir8);
					buttonPlay = 1;
					startStopSound();
				}
				else if(buttonPlay == 1){
					startStopSound();
				}
				else {
					startStopSound();
					mp = MediaPlayer.create(getApplicationContext(), R.raw.audir8);
					buttonPlay = 1;
					startStopSound();
				}
			}*/

Falls es jetzt abstürzt zeig mal deine beiden XML ausm res/Layout ordner.
 
Zuletzt bearbeitet:
Also es kommt jetzt bis zur mainactivity (nur bei Methode 1)
Aber sobald es dort ist stürzt es ab.
Wie schon vorher im Video, zeigt es wieder bei der App oben Mainactivity anstatt den Appname an.

Activity Main Layout:
Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginLeft="24dp"
        android:layout_marginTop="59dp"
        android:text="@string/audir8"
        android:onClick="onButtonClick" />

</RelativeLayout>

audir81.xml:

Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Audir81Activity" >

    <Button
        android:id="@+id/audi1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:text="@string/audir8sound"
        android:onClick="mpButtonClick" />

</RelativeLayout>


Code:
04-11 17:27:38.401: I/dalvikvm(1443): threadid=3: reacting to signal 3
04-11 17:27:38.531: I/dalvikvm(1443): Wrote stack traces to '/data/anr/traces.txt'
04-11 17:27:38.901: I/dalvikvm(1443): threadid=3: reacting to signal 3
04-11 17:27:38.931: I/dalvikvm(1443): Wrote stack traces to '/data/anr/traces.txt'
04-11 17:27:39.041: D/gralloc_goldfish(1443): Emulator without GPU emulation detected.
04-11 17:45:11.952: I/dalvikvm(1443): threadid=3: reacting to signal 3
04-11 17:45:11.972: I/dalvikvm(1443): Wrote stack traces to '/data/anr/traces.txt'
04-11 17:45:13.411: D/AndroidRuntime(1443): Shutting down VM
04-11 17:45:13.411: W/dalvikvm(1443): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
04-11 17:45:13.462: E/AndroidRuntime(1443): FATAL EXCEPTION: main
04-11 17:45:13.462: E/AndroidRuntime(1443): java.lang.IllegalStateException: Could not find a method mpButtonClick(View) in the activity class com.jannik.bestcarmotorsounds.Audir81Activity for onClick handler on view class android.widget.Button with id 'audi1'
04-11 17:45:13.462: E/AndroidRuntime(1443): 	at android.view.View$1.onClick(View.java:3031)
04-11 17:45:13.462: E/AndroidRuntime(1443): 	at android.view.View.performClick(View.java:3511)
04-11 17:45:13.462: E/AndroidRuntime(1443): 	at android.view.View$PerformClick.run(View.java:14105)
04-11 17:45:13.462: E/AndroidRuntime(1443): 	at android.os.Handler.handleCallback(Handler.java:605)
04-11 17:45:13.462: E/AndroidRuntime(1443): 	at android.os.Handler.dispatchMessage(Handler.java:92)
04-11 17:45:13.462: E/AndroidRuntime(1443): 	at android.os.Looper.loop(Looper.java:137)
04-11 17:45:13.462: E/AndroidRuntime(1443): 	at android.app.ActivityThread.main(ActivityThread.java:4424)
04-11 17:45:13.462: E/AndroidRuntime(1443): 	at java.lang.reflect.Method.invokeNative(Native Method)
04-11 17:45:13.462: E/AndroidRuntime(1443): 	at java.lang.reflect.Method.invoke(Method.java:511)
04-11 17:45:13.462: E/AndroidRuntime(1443): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
04-11 17:45:13.462: E/AndroidRuntime(1443): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
04-11 17:45:13.462: E/AndroidRuntime(1443): 	at dalvik.system.NativeStart.main(Native Method)
04-11 17:45:13.462: E/AndroidRuntime(1443): Caused by: java.lang.NoSuchMethodException: mpButtonClick [class android.view.View]
04-11 17:45:13.462: E/AndroidRuntime(1443): 	at java.lang.Class.getConstructorOrMethod(Class.java:460)
04-11 17:45:13.462: E/AndroidRuntime(1443): 	at java.lang.Class.getMethod(Class.java:915)
04-11 17:45:13.462: E/AndroidRuntime(1443): 	at android.view.View$1.onClick(View.java:3024)
04-11 17:45:13.462: E/AndroidRuntime(1443): 	... 11 more
04-11 17:45:14.091: I/dalvikvm(1443): threadid=3: reacting to signal 3
04-11 17:45:14.101: I/dalvikvm(1443): Wrote stack traces to '/data/anr/traces.txt'
04-11 17:45:14.741: I/dalvikvm(1443): threadid=3: reacting to signal 3
04-11 17:45:14.771: I/dalvikvm(1443): Wrote stack traces to '/data/anr/traces.txt'
04-11 17:45:15.221: I/dalvikvm(1443): threadid=3: reacting to signal 3
04-11 17:45:15.241: I/dalvikvm(1443): Wrote stack traces to '/data/anr/traces.txt'
 
Zuletzt bearbeitet:
:confused2:Ich bin mir net sicher aber aber des mit dem onClick in den XML könnte die Ursache sein. Ich mach des schon länger net mehr so. Weiß zwar net mehr warum aber ich setze immer ein setOnClickListener auf das Button Objekt.

Nach deinem LogCat bin ich mir sicher. Er findet die onClick Methode "mpButtonClick(View)" nicht da du in der Audir81Activity nen setOnClickListener hast.

Lösch mal beide onClick Methoden aus den XML´s damit es so aussieht.

Activity Main Layout:

Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginLeft="24dp"
        android:layout_marginTop="59dp"
        android:text="@string/audir8" />

</RelativeLayout>

audir81.xml:

Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Audir81Activity" >

    <Button
        android:id="@+id/audi1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:text="@string/audir8sound"/>

</RelativeLayout>

Die MainActivity sollte dann so aussehen:

Code:
package com.jannik.bestcarmotorsounds;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {
	
	private Button button1;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		button1 = (Button)findViewById(R.id.button1);
		
		button1.setOnClickListener(new OnClickListener(){
			public void onClick (View v) {
				Intent intent = new Intent(getApplicationContext(), Audir81Activity.class);
				startActivity(intent);
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}
}

Audir81Activity hat der Button die falsche id. Du nimmst den "button1" aus der MainActivity statt den "audi1"

Code:
package com.jannik.bestcarmotorsounds;

import android.media.MediaPlayer;
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Audir81Activity extends Activity {

	private static MediaPlayer mp;
	Button audi1;
	int buttonPlay;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.audir81);
		
		
		buttonPlay = -1;
		mp = MediaPlayer.create(getApplicationContext(), R.raw.audir8);
		
		audi1=(Button) findViewById ([COLOR="Red"]R.id.audi1)[/COLOR];
		
		audi1.setOnClickListener (new OnClickListener() {
			public void onClick (View v) {
				if(buttonPlay == 0){
					mp = MediaPlayer.create(getApplicationContext(), R.raw.audir8);
					buttonPlay = 1;
					startStopSound();
				}
				else if(buttonPlay == 1){
					startStopSound();
				}
				else {
					startStopSound();
					mp = MediaPlayer.create(getApplicationContext(), R.raw.audir8);
					buttonPlay = 1;
					startStopSound();
				}
			}
		});	
		
		
	}
	
	private void startStopSound(){ 
		
		if(buttonPlay == -1){
			mp.stop();
			mp.reset();
			mp.release();
			buttonPlay = 0;
		}
		else if(mp.isPlaying() == true){
			mp.stop();
			mp.reset();
			mp.release();
			buttonPlay = 0;
		}
		else{
			mp.start();
			}
	}
	protected void onPause(){
		super.onPause();
		
		if(mp.isPlaying() == true){
		        mp.stop();
			mp.reset();
			mp.release();
			buttonPlay = 0;
					
		}
		
	}
	
}

Also wenn es jetzt nicht geht weiß ich auch net mehr weiter.
 
Zuletzt bearbeitet:
  • Danke
Reaktionen: Jajobe
Klappt perfekt. RIESEN RIESEN DANK für deinen Beistand.
Endlich. DANKE :thumbup:

Nur wenn man die Zurücktaste drückt, stürzt die App ab. Aber das bekomme ich selber noch in den Griff :)
 
Also ich habe jetzt noch weitere Button mit weiteren Seiten eingefügt, die auch jeweils einen Ton abspielen sollen. Doch irgendwie spielt es immer nur den gleichen Ton ab und es öffnet sich immer nur die Main Activity, obwohl ich alles umgeschrieben habe :(

Main.xml
Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:layout_marginLeft="24dp"
        android:layout_marginTop="59dp"
        android:text="@string/audir8" />

    <Button
        android:id="@+id/button2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/button1"
        android:layout_below="@+id/button1"
        android:layout_marginTop="28dp"
        android:text="@string/audirs6" />

    <Button
        android:id="@+id/button3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/button2"
        android:layout_centerVertical="true"
        android:text="@string/audirs3" />

</RelativeLayout>

MainActivity:

Code:
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {
	
	private Button button1,button2,button3;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		button1 = (Button)findViewById(R.id.button1);
		
		button1.setOnClickListener(new OnClickListener(){
			public void onClick (View v) {
				Intent intent = new Intent(getApplicationContext(), Audir81Activity.class);
				startActivity(intent);
			}
		});
		
        button2 = (Button)findViewById(R.id.button2);
		
		button2.setOnClickListener(new OnClickListener(){
			public void onClick (View v) {
				Intent intent = new Intent(getApplicationContext(), Audir81Activity.class);
				startActivity(intent);
			}
		});
		
button3 = (Button)findViewById(R.id.button3);
		
		button3.setOnClickListener(new OnClickListener(){
			public void onClick (View v) {
				Intent intent = new Intent(getApplicationContext(), Audir81Activity.class);
				startActivity(intent);
			}
		});
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}
}

audir81.xml, audirs61.xml (abgeändert wie unten), audirs31.xml (abgeändert wie unten):

Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".Audir81Activity" >

    <Button
        android:id="@+id/audi1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:text="@string/audir8sound"/>

</RelativeLayout>

audir81activity, audirs61, audirs31 (beides mal richtig angepasst):

Code:
package com.jannik.carsounds;

import android.media.MediaPlayer;
import android.os.Bundle;
import android.app.Activity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Audir81Activity extends Activity {

	private static MediaPlayer mp;
	Button audi1;
	int buttonPlay;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.audir81);
		
		
		buttonPlay = -1;
		mp = MediaPlayer.create(getApplicationContext(), R.raw.audir8);
		
		audi1=(Button) findViewById (R.id.audi1);
		
		audi1.setOnClickListener (new OnClickListener() {
			public void onClick (View v) {
				if(buttonPlay == 0){
					mp = MediaPlayer.create(getApplicationContext(), R.raw.audir8);
					buttonPlay = 1;
					startStopSound();
				}
				else if(buttonPlay == 1){
					startStopSound();
				}
				else {
					startStopSound();
					mp = MediaPlayer.create(getApplicationContext(), R.raw.audir8);
					buttonPlay = 1;
					startStopSound();
				}
			}
		});	
		
		
	}
	
	private void startStopSound(){ 
		
		if(buttonPlay == -1){
			mp.stop();
			mp.reset();
			mp.release();
			buttonPlay = 0;
		}
		else if(mp.isPlaying() == true){
			mp.stop();
			mp.reset();
			mp.release();
			buttonPlay = 0;
		}
		else{
			mp.start();
			}
	}
	protected void onPause(){
		super.onPause();
		
		if(mp.isPlaying() == true){
		        mp.stop();
			mp.reset();
			mp.release();
			buttonPlay = 0;
					
		}
		
	}
	
}
 
Wie ist denn die button ID in den anderen layouts?

MainActivity sind zwei Fehler. Guck mal bei button 2 und 3 was du für ne Activity startest.

Gesendet von meinem Nexus 4 mit Tapatalk 2
 
Zuletzt bearbeitet:
Auch audi1. Aber als ich es mal geändert habe, hat sich nichts verändert.:confused2:
 
Ein guter Tipp. Verwende jede ID nur einmal. Nenn die mal audi1,audi2,audi3.

Gesendet von meinem Nexus 4 mit Tapatalk 2
 
  • Danke
Reaktionen: Jajobe
Muss ich mal probieren. Aber ich habe auch ein imageview eingefügt und die hat es auch nicht angezeigt.
 
Wo eingefügt? Ich seh kein ImageView?
 
Ja des habe ich wieder entfernt gehabt. Möchte erstmal dass der richtige Ton läuft. Und dann wollte ich die app ein bisschen verschönern :D
 
Also ich habe die Button jetzt mal umbenannt. Hat sich nichts geändert :/
Immer noch für jeden Button der gleiche Sound. Irgendwie öffnet sich auch immer die gleiche MainActivity habe ich das Gefühl.
Ein Video dazu:
 
Zuletzt bearbeitet von einem Moderator:
Das liegt daran das du fast gar kein Grundwissen hast... Ich hab doch gesagt du sollst in der MainActivity mal schauen welche Activity du mit den drei Buttons startest. Es ist nämlich immer die erste Activity. Die anderen zwei Activitys mit dein Soundbutton haste gar nicht eingetragen. Mehr Hilfe gebe ich dir erstmal nicht. Such mal bei Google neue Activity starten und versuch es zu verstehen. Falls du dann fragen hast melde dich wieder. Ich denke es bringt nichts dir alles vor zu schmeißen und du verstehst net was du da machst.

Gesendet von meinem Nexus 4 mit Tapatalk 2
 
Ok.Dann lese ich mich mal schlau. Danke nochmal für die Unterstützung bis dahin :thumbsup:

Der ursprüngliche Beitrag von 14:41 Uhr wurde um 14:49 Uhr ergänzt:

Habe es jetzt rausgefunden :)))

Man muss bei:
intent intent = new Intent(getApplicationContext(), seitennameActivity.class);

einfach ändern. Dann funktioniert auch der richtige Sound :)
 
Genau ;)

Gehts schon? Ansonsten schmeiß ich setContentView, in den Activitys die du starten willst, in den Raum. :D

Gesendet von meinem Nexus 4 mit Tapatalk 2
 
Ne brauchts nicht. Jetzt klappt wirklich alles perfekt und nochmal riesen riesen Dank für den Beitstand :smile:
 
Kein Problem. ;)

Haste des mit dem Absturz beim zurück in den Griff bekommen ?

Gesendet von meinem Nexus 4 mit Tapatalk 2
 
Nein Noch nicht. Aber wenn der Ton abgespielt wird und man zurück drückt stürzt es nicht ab.
Aber die Abstürze bekomme ich noch in den griff. :sneaky:
 
Ich hab das Problem auch schon bemerkt. Ich habe damals vergessen @Override über die onPause() zu schreiben damit sie überschrieben wird.

Das hat das Problem aber nicht ganz behoben wo ich auch keinen Ansatz mehr habe was des Problem is...

Deswegen schreib einfach einen Try/Catch Block und dann läufts hoff ich. Schau dir das aber mal mit Lifecycle einer Android App an. Ist ne wichtige Sache. Genauso wie das überschreiben der Methoden und Try/Catch.

Hier der Code wo ich eben gemeint hab.

Code:
@Override
protected void onPause(){
	super.onPause();
	
	try{
	if(mp.isPlaying() == true){
				mp.stop();
				mp.reset();
				mp.release();
				buttonPlay = 0;
	}
	}catch(IllegalStateException e){}		
}
 
Zurück
Oben Unten