那麼,最好的我可以想出是一個web視圖。使用此代碼。首先這裏是java。
package com.stackoverflow.images.webview;
import android.app.*;
import android.os.*;
import android.view.*;
import android.widget.*;
import android.content.*;
import android.webkit.*;
public class Site extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.image);
WebView webView = (WebView)
findViewById(R.id.webview);
webView.loadUrl("http://examplesite.com/yourimage");
}
}
現在這裏是XML。只嘗試在JAVA和URL中更改上面的包。 確保一切是正確的JAVA上述起來像的onCreate佈局
<?xml version="1.0" encoding="utf-8"?>
<WebView
android:id="@+id/webview"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
</WebView>
你希望能在您的應用程序來查看它? – apw2012 2012-09-29 00:19:03
是的,在我的應用程序中查看,或者,例如,如果我有一個URL是圖像資源,在手機上啓動圖像查看器。我只需要在一個變量中捕獲URL。 – 2012-09-29 07:40:50