Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在开发一个应用程序,其中我有一个关卡完成的片段,我想在这个片段加载时播放声音。
我认为我必须在 onCreate 方法中编写 MediaPlayer,但我不知道如何编写 MediaPlayer 代码。
我已经在原始文件夹中加载了 mp3 文件
MediaPlayer player = MediaPlayer.create(Activity.this, R.raw.some_file); player.start();