Question

I have a serious problem. I researched it for two days, but I can't solve it. When I run my app, I get an error.

package jl.a.simple;

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

public class AudioSimpleActivity extends Activity {
    /** Called when the activity is first created. */
    Button btn_play;
    MediaPlayer mMediaPlayer;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        btn_play=(Button)findViewById(R.id.simple);
        btn_play.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                mMediaPlayer=MediaPlayer.create(AudioSimpleActivity.this,R.drawable.testaudio );
                mMediaPlayer.start();
                mMediaPlayer.setOnCompletionListener(new OnCompletionListener() {

                    @Override
                    public void onCompletion(MediaPlayer mp) {
                        // TODO Auto-generated method stub

                    }
                });
            }
        });
    }
}

LOGCAT ....................

05-18 16:45:15.429: I/ApplicationPackageManager(22388): cscCountry is not German : XXV
05-18 16:45:20.919: D/BatteryService(162): update start
05-18 16:45:20.919: D/BatteryService(162): update start
05-18 16:45:20.929: D/BatteryService(162): update start
05-18 16:45:25.329: D/AndroidRuntime(27725): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
05-18 16:45:25.329: D/AndroidRuntime(27725): CheckJNI is OFF
05-18 16:45:25.329: D/AndroidRuntime(27725): setted country_code = VIETNAM
05-18 16:45:25.329: D/AndroidRuntime(27725): setted sales_code = XXV
05-18 16:45:25.329: D/AndroidRuntime(27725): found sales_code tag = <XXV>, </XXV> 
05-18 16:45:25.329: E/AndroidRuntime(27725): /system/csc/feature.xml ==> cannot open file
05-18 16:45:25.649: D/AndroidRuntime(27725): Calling main entry com.android.commands.pm.Pm
05-18 16:45:25.659: D/AndroidRuntime(27725): Shutting down VM
05-18 16:45:25.679: I/AndroidRuntime(27725): NOTE: attach of thread 'Binder Thread #3' failed
05-18 16:45:26.049: D/AndroidRuntime(27735): >>>>>> AndroidRuntime START com.android.internal.os.RuntimeInit <<<<<<
05-18 16:45:26.049: D/AndroidRuntime(27735): CheckJNI is OFF
05-18 16:45:26.049: D/AndroidRuntime(27735): setted country_code = VIETNAM
05-18 16:45:26.049: D/AndroidRuntime(27735): setted sales_code = XXV
05-18 16:45:26.049: D/AndroidRuntime(27735): found sales_code tag = <XXV>, </XXV> 
05-18 16:45:26.049: E/AndroidRuntime(27735): /system/csc/feature.xml ==> cannot open file
05-18 16:45:26.339: D/AndroidRuntime(27735): Calling main entry com.android.commands.am.Am
05-18 16:45:26.359: I/ActivityManager(162): Force stopping package jl.a.simple uid=10088
05-18 16:45:26.379: I/OrientationDebug(162): [pwm] in updateOrientationListenerLp()
05-18 16:45:26.379: V/OrientationDebug(162): in updateOrientationListenerLp(), Screen status=true, current orientation=5, SensorEnabled=false
05-18 16:45:26.379: I/OrientationDebug(162): [pwm] needSensorRunningLp(), return false #3
05-18 16:45:26.389: I/WindowManager(162): WIN DEATH: Window{408535b8 jl.a.simple/jl.a.simple.AudioSimpleActivity paused=false}
05-18 16:45:26.399: I/Launcher(246): onResume(). mIsNewIntent : false
05-18 16:45:26.419: D/ProgramMonitor(27518):  onReceive -no
05-18 16:45:26.419: D/ProgramMonitor(27518): appWidgetIds.length : 0
05-18 16:45:26.419: D/ProgramMonitor(27518):  onReceive - action:com.sec.android.app.controlpanel.RUNNING_PROGRAM_REQ
05-18 16:45:26.419: E/Launcher(246): setWindowOpaque()
05-18 16:45:26.429: I/ActivityManager(162): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=jl.a.simple/.AudioSimpleActivity } from pid 27735
05-18 16:45:26.449: D/AndroidRuntime(27735): Shutting down VM
05-18 16:45:26.469: E/Launcher(246): MTP-LAUNCHER: media scanning not yet finished. 
05-18 16:45:26.469: I/AndroidRuntime(27735): NOTE: attach of thread 'Binder Thread #3' failed
05-18 16:45:26.479: I/Launcher(246): onResume() ended
05-18 16:45:26.509: I/Launcher(246): onPause()
05-18 16:45:26.529: I/Launcher(246): onWindowFocusChanged(true)
05-18 16:45:26.529: D/Launcher(246): setWallpaperDimension() called
05-18 16:45:26.529: D/Launcher(246): USE_NON_SCROLLABLE_IMAGE_WALLPAPER is true
05-18 16:45:26.529: D/Launcher(246): It's image wallpaper. suggestDesiredDimensions(-1,-1)
05-18 16:45:26.529: E/Launcher(246): setWindowOpaque()
05-18 16:45:26.529: I/ActivityManager(162): Start proc jl.a.simple for activity jl.a.simple/.AudioSimpleActivity: pid=27744 uid=10088 gids={}
05-18 16:45:26.629: I/OrientationDebug(162): [pwm] in updateOrientationListenerLp()
05-18 16:45:26.639: V/OrientationDebug(162): in updateOrientationListenerLp(), Screen status=true, current orientation=-1, SensorEnabled=false
05-18 16:45:26.639: I/OrientationDebug(162): [pwm] needSensorRunningLp(), return false #3
05-18 16:45:26.649: I/Launcher(246): onWindowFocusChanged(false)
05-18 16:45:26.649: D/Launcher(246): setWallpaperDimension() called
05-18 16:45:26.649: D/Launcher(246): USE_NON_SCROLLABLE_IMAGE_WALLPAPER is true
05-18 16:45:26.659: W/ActivityThread(27744): Application jl.a.simple is waiting for the debugger on port 8100...
05-18 16:45:26.679: I/System.out(27744): Sending WAIT chunk
05-18 16:45:26.679: D/Launcher(246): It's image wallpaper. suggestDesiredDimensions(-1,-1)
05-18 16:45:26.989: D/ProgramMonitor(27518):  onReceive - action:com.sec.android.app.controlpanel.RUNNING_PROGRAM_ACK
05-18 16:45:26.989: D/ProgramMonitor(27518): updateNumberText
05-18 16:45:27.079: I/System.out(27744): Debugger has connected
05-18 16:45:27.079: I/System.out(27744): waiting for debugger to settle...
05-18 16:45:27.299: I/System.out(27744): waiting for debugger to settle...
05-18 16:45:27.499: I/System.out(27744): waiting for debugger to settle...
05-18 16:45:27.579: D/ProgramMonitor(27518): updateWidget
05-18 16:45:27.589: D/ProgramMonitor(27518): updateWidget - appWidgetIds == null -->> resetting
05-18 16:45:27.589: D/ProgramMonitor(27518): updateWidget - appWidgetIds.length == 0
05-18 16:45:27.699: I/System.out(27744): waiting for debugger to settle...
05-18 16:45:27.899: I/System.out(27744): waiting for debugger to settle...
05-18 16:45:28.099: I/System.out(27744): waiting for debugger to settle...
05-18 16:45:28.309: I/System.out(27744): waiting for debugger to settle...
05-18 16:45:28.509: I/System.out(27744): waiting for debugger to settle...
05-18 16:45:28.709: I/System.out(27744): waiting for debugger to settle...
05-18 16:45:28.909: I/System.out(27744): waiting for debugger to settle...
05-18 16:45:29.109: I/System.out(27744): waiting for debugger to settle...
05-18 16:45:29.309: I/System.out(27744): waiting for debugger to settle...
05-18 16:45:29.509: I/System.out(27744): debugger has settled (1322)
05-18 16:45:29.709: I/ApplicationPackageManager(27744): cscCountry is not German : XXV
05-18 16:45:29.899: W/InputManagerService(162): Got RemoteException sending setActive(false) notification to pid 27692 uid 10088
05-18 16:45:29.909: E/AxT9IME(234): setEditorType() - restarting : false
05-18 16:45:29.909: E/AxT9IME(234):  mRestartRequested : false
05-18 16:45:29.909: E/AxT9IME(234):  mIsScreenLocked : false
05-18 16:45:29.909: E/Vivek(234): mInputLanguage = 4242
05-18 16:45:29.969: I/ActivityManager(162): Displayed jl.a.simple/.AudioSimpleActivity: +3s444ms
05-18 16:45:30.009: D/ProgramMonitor(27518):  onReceive - action:com.sec.android.app.controlpanel.CPU_USAGE_WARN
05-18 16:45:30.009: I/ProgramMonitor(27518): cpu_usage_wan
05-18 16:45:30.009: D/ProgramMonitor(27518): updateSlideText
05-18 16:45:30.009: D/ProgramMonitor(27518): updateDefaultText
05-18 16:45:30.019: D/ProgramMonitor(27518): updateWidget
05-18 16:45:30.019: D/ProgramMonitor(27518): updateWidget - appWidgetIds == null -->> resetting
05-18 16:45:30.029: D/ProgramMonitor(27518): updateWidget - appWidgetIds.length == 0
05-18 16:45:30.939: D/BatteryService(162): update start
05-18 16:45:30.939: D/BatteryService(162): update start
05-18 16:45:30.949: D/BatteryService(162): update start
05-18 16:45:32.840: I/InputReader(162): dispatchTouch::touch event's action is 0
05-18 16:45:32.840: I/InputDispatcher(162): Delivering touch to current input target: action: 0, channel '407d3080 jl.a.simple/jl.a.simple.AudioSimpleActivity (server)'
05-18 16:45:32.840: D/PowerManagerService(162): reactivateScreenLocksLocked mProxIgnoredBecauseScreenTurnedOff=false
05-18 16:45:32.840: I/PowerManagerService(162): Ulight 1->7|0
05-18 16:45:32.840: D/PowerManagerService(162): setLightBrightness : mButtonLight : 30
05-18 16:45:32.929: I/InputReader(162): dispatchTouch::touch event's action is 1
05-18 16:45:32.929: I/InputDispatcher(162): Delivering touch to current input target: action: 1, channel '407d3080 jl.a.simple/jl.a.simple.AudioSimpleActivity (server)'
05-18 16:45:33.089: I/PowerManagerService(162): Light Animator Finished curIntValue=30
05-18 16:45:35.289: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:45:36.290: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:45:38.290: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:45:38.939: W/PowerManagerService(162): Timer 0x7->0x3|0x1
05-18 16:45:38.939: I/PowerManagerService(162): Ulight 7->3|0
05-18 16:45:38.939: D/PowerManagerService(162): setLightBrightness : mButtonLight : 0
05-18 16:45:39.289: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:45:40.960: D/BatteryService(162): update start
05-18 16:45:40.960: D/BatteryService(162): update start
05-18 16:45:40.970: D/BatteryService(162): update start
05-18 16:45:41.289: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:45:42.289: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:45:44.299: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:45:45.300: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:45:50.300: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:45:50.979: D/BatteryService(162): update start
05-18 16:45:50.979: D/BatteryService(162): update start
05-18 16:45:50.989: D/BatteryService(162): update start
05-18 16:45:55.939: I/InputReader(162): dispatchTouch::touch event's action is 0
05-18 16:45:55.939: I/InputDispatcher(162): Delivering touch to current input target: action: 0, channel '407d3080 jl.a.simple/jl.a.simple.AudioSimpleActivity (server)'
05-18 16:45:55.939: I/PowerManagerService(162): Ulight 3->7|0
05-18 16:45:55.939: D/PowerManagerService(162): setLightBrightness : mButtonLight : 30
05-18 16:45:55.969: I/InputReader(162): dispatchTouch::touch event's action is 1
05-18 16:45:55.969: I/InputDispatcher(162): Delivering touch to current input target: action: 1, channel '407d3080 jl.a.simple/jl.a.simple.AudioSimpleActivity (server)'
05-18 16:45:55.989: W/ResourceType(27744): getEntry failing because entryIndex 2 is beyond type entryCount 2
05-18 16:45:55.989: W/ResourceType(27744): Failure getting entry for 0x7f020002 (t=1 e=2) in package 0 (error -2147483647)
05-18 16:45:56.299: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:45:59.309: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:46:00.999: D/BatteryService(162): update start
05-18 16:46:00.999: D/BatteryService(162): update start
05-18 16:46:01.009: D/BatteryService(162): update start
05-18 16:46:01.979: W/PowerManagerService(162): Timer 0x7->0x3|0x1
05-18 16:46:01.979: I/PowerManagerService(162): Ulight 7->3|0
05-18 16:46:01.979: D/PowerManagerService(162): setLightBrightness : mButtonLight : 0
05-18 16:46:02.310: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:46:03.309: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:46:06.309: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:46:08.319: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:46:11.019: D/BatteryService(162): update start
05-18 16:46:11.019: D/BatteryService(162): update start
05-18 16:46:11.029: D/BatteryService(162): update start
05-18 16:46:16.029: I/InputReader(162): dispatchTouch::touch event's action is 0
05-18 16:46:16.029: I/InputDispatcher(162): Delivering touch to current input target: action: 0, channel '407d3080 jl.a.simple/jl.a.simple.AudioSimpleActivity (server)'
05-18 16:46:16.029: I/PowerManagerService(162): Ulight 3->7|0
05-18 16:46:16.029: D/PowerManagerService(162): setLightBrightness : mButtonLight : 30
05-18 16:46:16.130: I/InputReader(162): dispatchTouch::touch event's action is 1
05-18 16:46:18.330: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:46:20.489: I/ApplicationPackageManager(22388): cscCountry is not German : XXV
05-18 16:46:21.039: D/BatteryService(162): update start
05-18 16:46:21.039: D/BatteryService(162): update start
05-18 16:46:21.049: D/BatteryService(162): update start
05-18 16:46:21.319: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:46:22.139: W/PowerManagerService(162): Timer 0x7->0x3|0x1
05-18 16:46:22.139: I/PowerManagerService(162): Ulight 7->3|0
05-18 16:46:22.139: D/PowerManagerService(162): setLightBrightness : mButtonLight : 0
05-18 16:46:29.329: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:46:30.329: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:46:31.060: D/BatteryService(162): update start
05-18 16:46:31.060: D/BatteryService(162): update start
05-18 16:46:31.070: D/BatteryService(162): update start
05-18 16:46:32.329: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:46:35.339: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:46:36.150: I/InputDispatcher(162): Application is not responding: Window{407d3080 jl.a.simple/jl.a.simple.AudioSimpleActivity paused=false}.  20020.6ms since event, 20020.4ms since wait started
05-18 16:46:36.150: I/InputDispatcher(162): Current inboundQueue's length is 0, outboundQueue's length is 1
05-18 16:46:36.150: I/InputDispatcher(162): outboundQueue 0: inProgress is 1, type is 3
05-18 16:46:36.150: D/InputDispatcher(162): findTouchedWindow finished: injectionResult=-1, injectionPermission=1, timeSpentWaitingForApplication=20020.4ms
05-18 16:46:36.150: D/InputDispatcher(162): findTouchedWindow finished: injectionResult=-1, injectionPermission=1, timeSpentWaitingForApplication=20021.4ms
05-18 16:46:36.150: I/WindowManager(162): Input event dispatching timed out sending to jl.a.simple/jl.a.simple.AudioSimpleActivity
05-18 16:46:36.329: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
05-18 16:46:41.080: D/BatteryService(162): update start
05-18 16:46:41.080: D/BatteryService(162): update start
05-18 16:46:41.090: D/BatteryService(162): update start
05-18 16:46:41.339: D/StatusBarPolicy(226): updateSignalStrength: numeric=45204, curOperator=VIETTEL
Was it helpful?

Solution

specifically your layout has problem. i change it with my own layout and move your audio to raw folder, i thing it's better. then i get output. and that was a good music :D .

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top