English 中文(简体)
LogCatError “setDataSource: JNI的外部途径是?x@”在与媒体互动者玩音乐时
原标题:LogCatError "setDataSource: outside path in JNI is ?x@" when playing music with mediaplayer
  • 时间:2011-11-18 16:42:59
  •  标签:
  • android

在与媒体演奏者接触音乐档案时,我有奇怪的问题。

退步始于没有任何问题,一切都不起作用。 app机坠毁。 但是,每当我选择一首歌时,我就拿到了以下的LogCatError:

11-18 16:26:19.800:E/MediaPlayer(11367): JAVA 道路

11-18 16:26:19.800: E/MediaPlayer-JNI(11367): setDataSource: outside path in JNI is ?x@

11-18 16:26:19.855:E/MediaPlayer(11367): 准备

页: 1

我没有从互联网上下载文件,我只是拍摄了该装置上储存的歌曲。

如果没有人能够给我一个解决办法,如果有人能向我解释这一错误,那将是 n。

最佳回答

• 利用媒体演员数据来源,如:

try {
                mp.setDataSource(getApplicationContext(), ringtoneUri);
            } catch (IllegalArgumentException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            } catch (SecurityException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            } catch (IllegalStateException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            } catch (IOException e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }

You have to catch all Exceptions. This worked for me.

问题回答

尝试利用ES卷宗探索者或类似手段,检查你想要做的文档的特性/性能,并试图使其世界能够读取。

我也存在同样的问题,该档案采用“*.wmv”格式,然后将档案转换为“mp3”,并尝试了同样的编号,请在后面找到编码。

try {
            MediaPlayer player = new MediaPlayer();
            player.setAudioStreamType(AudioManager.STREAM_MUSIC);
            player.setDataSource("http://Server.com/XXXX.mp3");
            player.prepare();
            player.start();
        } catch (Exception e) {
            // TODO: handle exception
            e.printStackTrace();
        }




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签