Using java Syntax Highlighting
- public class MainActivity extends Activity {
- Button myButton;
- private SoundManager mSoundManager;
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- this.setContentView(R.layout.main);
- mSoundManager = new SoundManager();
- mSoundManager.initSounds(getBaseContext());
- mSoundManager.addSound(1, R.raw.a);
- myButton = (Button)this.findViewById(R.id.my_button);
- myButton.setOnClickListener(new OnClickListener() {
- @Override
- public void onClick(View v) {
- try {
- mSoundManager.playSound(1);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- });
- }
- }
Parsed in 0.032 seconds, using GeSHi 1.0.8.4
I have that but it crashes my application and the debug
Using java Syntax Highlighting
- 20:51:12.061 916 ERROR AndroidRuntime Uncaught handler: thread main exiting due to uncaught exception
- 20:51:12.092 916 ERROR AndroidRuntime java.lang.RuntimeException: Unable to start activity ComponentInfo{org.me.zx/org.me.zx.MainActivity}: android.content.res.Resources$NotFoundException: File res/raw/a.ogg from drawable resource ID #0x7f040000
- 20:51:12.092 916 ERROR AndroidRuntime at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
- 20:51:12.092 916 ERROR AndroidRuntime at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
- 20:51:12.092 916 ERROR AndroidRuntime at android.app.ActivityThread.access$1800(ActivityThread.java:112)
- 20:51:12.092 916 ERROR AndroidRuntime at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
- 20:51:12.092 916 ERROR AndroidRuntime at android.os.Handler.dispatchMessage(Handler.java:99)
- 20:51:12.092 916 ERROR AndroidRuntime at android.os.Looper.loop(Looper.java:123)
- 20:51:12.092 916 ERROR AndroidRuntime at android.app.ActivityThread.main(ActivityThread.java:3948)
- 20:51:12.092 916 ERROR AndroidRuntime at java.lang.reflect.Method.invokeNative(Native Method)
- 20:51:12.092 916 ERROR AndroidRuntime at java.lang.reflect.Method.invoke(Method.java:521)
- 20:51:12.092 916 ERROR AndroidRuntime at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
- 20:51:12.092 916 ERROR AndroidRuntime at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
- 20:51:12.092 916 ERROR AndroidRuntime at dalvik.system.NativeStart.main(Native Method)
- 20:51:12.092 916 ERROR AndroidRuntime Caused by: android.content.res.Resources$NotFoundException: File res/raw/a.ogg from drawable resource ID #0x7f040000
- 20:51:12.092 916 ERROR AndroidRuntime at android.content.res.Resources.openRawResourceFd(Resources.java:814)
- 20:51:12.092 916 ERROR AndroidRuntime at android.media.SoundPool.load(SoundPool.java:172)
- 20:51:12.092 916 ERROR AndroidRuntime at org.me.zx.SoundManager.addSound(SoundManager.java:27)
- 20:51:12.092 916 ERROR AndroidRuntime at org.me.zx.MainActivity.onCreate(MainActivity.java:22)
- 20:51:12.092 916 ERROR AndroidRuntime at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
- 20:51:12.092 916 ERROR AndroidRuntime at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
- 20:51:12.092 916 ERROR AndroidRuntime ... 11 more
- 20:51:12.092 916 ERROR AndroidRuntime Caused by: java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
- 20:51:12.092 916 ERROR AndroidRuntime at android.content.res.AssetManager.openNonAssetFdNative(Native Method)
- 20:51:12.092 916 ERROR AndroidRuntime at android.content.res.AssetManager.openNonAssetFd(AssetManager.java:412)
- 20:51:12.092 916 ERROR AndroidRuntime at android.content.res.Resources.openRawResourceFd(Resources.java:811)
- 20:51:12.092 916 ERROR AndroidRuntime ... 16 more
Parsed in 0.039 seconds, using GeSHi 1.0.8.4
I will pay 5$ if someone helps me fix this. Contact me at beqiraj@gmail.com


