标签:
package com.example.extab_text;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;
import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;
import android.app.Application;
public class MyAppliccation extends Application{
@Override
public void onCreate() {
// TODO Auto-generated method stub
super.onCreate();
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(this)
.defaultDisplayImageOptions(getOptions())
.build();
ImageLoader.getInstance().init(config);
}
private DisplayImageOptions getOptions() {
// TODO Auto-generated method stub
DisplayImageOptions options = new DisplayImageOptions.Builder()
.displayer(new RoundedBitmapDisplayer(10))
.build();
return options;
}
}
///////////////////////////////////////////////////////////////////////////////////
package com.example.extab_text;
import com.nostra13.universalimageloader.core.ImageLoader;
import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.widget.ImageView;
import android.widget.TextView;
public class DetailsActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_details);
init();
}
private void init() {
// TODO Auto-generated method stub
ImageView dimage=(ImageView) findViewById(R.id.dimage);
TextView dtitle=(TextView) findViewById(R.id.dtitle);
TextView ddesc=(TextView) findViewById(R.id.ddesc);
Intent intent = getIntent();
String title = intent.getStringExtra("title");
String picurl = intent.getStringExtra("picurl");
String desc = intent.getStringExtra("desc");
ImageLoader.getInstance().displayImage(picurl, dimage);
dtitle.setText(title);
ddesc.setText(desc);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_details, menu);
return true;
}
}
标签:
原文地址:http://www.cnblogs.com/6660qq/p/5158749.html