ich ein Bild in Bild Tabellenfeld habe, und ich möchte das Bild in meiner app verwenden meine PHP-Seite istBild Abrufen von mysql-php (android)
$user = array();
$user["image"] = base64_encode($result["image"]);
// success
$response["success"] = 1;
// user node
$response["image_table"] = array();
array_push($response["image_table"], $user);
, wenn ich das Array in meinem app ich benutze diese ...
if (success == 1)
{
address = json.getJSONArray(TAG_IMAGE_TABLE);
for (int i = 0; i < address.length(); i++) {
JSONObject c = address.getJSONObject(i);
image = c.getString(TAG_IMAGE);
}
es mir wie
json response: {"success":1,"image_table": [{"image":"iVBORw0KGgoAAA...................."
Folge gibt, wenn ich dieses Bild in meiner Bildansicht verwenden Ich benutze diese wie
ImageView ivProperty = ((ImageView) myContentView.findViewById(R.id.image_property));
byte[] decodedString;
try {
decodedString = Base64.decode(image, Base64.URL_SAFE);
Bitmap decodedByte = BitmapFactory.decodeByteArray(decodedString, 0, decodedString.length);
ivProperty.setImageBitmap(decodedByte);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
aber es gibt mir Null-Zeiger Ausnahme
meine logcat Werte sind
03-27 10:10:44.355: E/AndroidRuntime(2391): java.lang.NullPointerException: Input string was null.
03-27 10:10:44.355: E/AndroidRuntime(2391): at com.big_property_info.Base64.decode(Base64.java:1242)
03-27 10:10:44.355: E/AndroidRuntime(2391): at com.big_property_info.MainActivityMap$GeocoderTask$2.getInfoContents(MainActivityMap.java:314)
Wie die NULL-Zeiger-Ausnahme lösen ..., wenn im Bild String empfangen .. ...
Hilf mir Freund Ich brauche deine Hilfe ....... – Tufan
't gibt mir das Ergebnis wie'. Was druckst du dort? Welches Ergebnis? Lege die Log-Anweisung zumindest in deinen Code, damit wir sehen können, was du druckst. – greenapps
Hier ist mein Logcat – Tufan