English 中文(简体)
图像下载
原标题:Downloading an Image

我正在下载图像,然后在我的照片中加以描述。 我正在取得非常不同的结果,这取决于我是如何管理的。 问题在于我下载图像。

public Drawable getImage() throws IOException, MalformedURLException {
    InputStream is = (InputStream) new java.net.URL(url).getContent();
    Drawable test = Drawable.createFromStream(is, "name");
    return test;
}//getImage

有时测试显示无效,有时下载。 我想指出,它为什么这样做。 我的问题是,发生这种情况的唯一时间是,我以正常方式(有可能被 de倒)地追求高棉梦想。 如果我跑到电话上台,通常会回去图像。 如果我对 em( de)进行控制,通常会恢复形象。 因此,当我能够通过欺骗获取我所需要的信息时,问题就会出现。

我是否可以补充任何守则来监测图像的下载情况?

最佳回答

只要该装置与计算机连接,你可以添加标识信息,以记录仪表。 2. 记录、使用ver、 de、信息、警告或错误记录水平如下(均称)

Log.v(...)
Log.d(...)
Log.i(...)
Log.w(...)
Log.e(...)

这将有助于你缩小所使用的参数,减少结果,以及你在出现这一错误时需要提供的任何其他信息。

问题回答

暂无回答




相关问题
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 ...

热门标签