Új hozzászólás Aktív témák
-
Sziasztok! Valamit nagyon rosszul csinálhatok mert sem a Picassoval sem az Universal Image Loaderrel nem jutok dűlőre.
Eclipset használok, bemásoltam az Universal Image Loader jar-t a libs folderbe, majd hozzáadtam a build path-hoz. Importok rendben, manifest elvileg rendben, legegyszerűbb műveletre (képbetöltés sima imageviewba) is lefagy.
MainActivity class
package com.picturetest;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageView;public class MainActivity extends Activity {
ImageView img;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);img = (ImageView) findViewById(R.id.imageView1);
// Create default options which will be used for every
// displayImage(...) call if no options will be passed to this method
DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder().cacheInMemory(true).cacheOnDisk(true).build();
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
.defaultDisplayImageOptions(defaultOptions).build();
ImageLoader.getInstance().init(config); // Do it on Application startString imageUri = "file://mnt/sdcard/default.png";
ImageLoader imageLoader = ImageLoader.getInstance();
imageLoader.displayImage(imageUri, img);
}
}activity_main.xml
<RelativeLayout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="0dp"
android:paddingBottom="0dp"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="0dp"
tools:context="com.picturetest.MainActivity"><ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="@drawable/ic_launcher" /></RelativeLayout>
Manifest
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.picturetest"
android:versionCode="1"
android:versionName="1.0" ><uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" /><uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Include following permission if you load images from Internet -->
<uses-permission android:name="android.permission.INTERNET" /><application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.picturetest.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>Az eclipse projektem feltöltöttem ide.
A fordítás hiba nélkül lefut, de ha elindítom az appot azonnal fagy. A default.png is a helyén van. Nexus 5
Mit csinálok rosszul?
Új hozzászólás Aktív témák
- Azonnali VGA-s kérdések órája
- A Micron szerint nem dobbantott a végfelhasználói piacról a Crucial eltűnésével
- BerserkGuts: 9800X3D Hitvallás, Dogma megcáfolása egy RTX5080+12600K-val
- Kormányok / autós szimulátorok topikja
- BestBuy ruhás topik
- Vicces képek
- LEGO klub
- iPhone topik
- Kegyvesztett lehet a Radeon termékskála középső tagja
- Teljesen szürrelális, ami az RTX 5070 Ti kapcsán történik...
- További aktív témák...
- 15.gen! Intel Core ULTRA 9 285K (24mag!) +16-32GB DDR5 +hűtött VRM-es Z890 lap! GAR/SZÁMLA (nevedre)
- AMD Ryzen 7800x3d - bontatlan, dobozos, garis
- Eladó PS Portal + kemény tok garanciás 2028.01.14-ig
- Apple iPhone 15 128 GB Pink 1 év Garancia Beszámítás Házhozszállítás
- új akku Ár/ÉRTÉK BAJNOK! Dell Latitude 5330 i3-1215U 6magos! - 16GB 256GB 13.3" FHD 1 év garancia
- Ultimate előfizetés akár 4714 Ft/hó áron! Azonnali, automatizált aktiválással, csak Nálam!
- HIBÁTLAN iPhone 13 128GB Blue -1 ÉV GARANCIA - Kártyafüggetlen, MS4245, 100% Akksi
- LicencAruhaz.hu OLCSÓ, LEGÁLIS SZOFTVEREK AZONNAL - Windows - Office - Win Server - ÖRÖK GARANCIÁVAL
- Apple iPhone 12 Pro / 128GB / Kártyafüggetlen / 12Hó Garancia / Akku: 83%
- iPhone 12 Pro 256GB Gold -1 ÉV GARANCIA - Kártyafüggetlen, MS3581
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


