cant call set pixel on a recycled bitmap (debugging) - android

I've read some things about this problem named in the title, but I can't fix it in my code.
Only the Debugger shows me that 'cant call set pixel on a recycled bitmap' and closes the app.
So It's clear, to get an mutable Bitmap and manage the bitmap right. But where is my mistake?
I hope you can help me.
...
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_localization);
this.bm = BitmapFactory.decodeResource(getResources(), R.drawable.raumstrukturapp);
this.picture = (ImageView) findViewById(R.id.picture);
this.picture.setImageResource(R.drawable.raumstrukturapp); calculatePositioniInPixel(infoccol.getBeaconRoomCollector().getBeaconRoom(0).getBeaconRoomeElements().get(0));
drawPosition(R.drawable.raumstrukturapp);
}
private void calculatePositioniInPixel(BeaconRoomElement bre) {
setKSUnit(9, 14);
this.coordInPixel[0][0] = bre.getElementcoordinates()[0][0] * this.xUnit;
Log.i("Beacons", "x links oben: " + this.coordInPixel[0][0]);
this.coordInPixel[0][1] = bre.getElementcoordinates()[0][1] * this.yUnit;
Log.i("Beacons", "y links oben: " + this.coordInPixel[0][1]);
this.coordInPixel[1][0] = bre.getElementcoordinates()[1][0] * this.xUnit;
Log.i("Beacons", "x rechts oben: " + this.coordInPixel[1][0]);
this.coordInPixel[1][1] = bre.getElementcoordinates()[1][1] * this.yUnit;
Log.i("Beacons", "y rechts oben: " + this.coordInPixel[1][1]);
this.coordInPixel[2][0] = bre.getElementcoordinates()[2][0] * this.xUnit;
Log.i("Beacons", "x rechts unten: " + this.coordInPixel[2][0]);
this.coordInPixel[2][1] = bre.getElementcoordinates()[2][1] * this.yUnit;
Log.i("Beacons", "y rechts unten: " + this.coordInPixel[2][1]);
this.coordInPixel[3][0] = bre.getElementcoordinates()[3][0] * this.xUnit;
Log.i("Beacons", "x links unten: " + this.coordInPixel[3][0]);
this.coordInPixel[3][1] = bre.getElementcoordinates()[3][1] + this.yUnit;
Log.i("Beacons", "y links unten: " + this.coordInPixel[3][1]);
}
...
private void drawPosition(int resID) {
bm = BitmapFactory.decodeResource(getResources(), R.drawable.raumstrukturapp);
mutableBm = convertToMutable(bm);
for(int i = (int) this.coordInPixel[0][0]; i <= this.coordInPixel[1][0]; i++) {
for(int j = (int)(this.coordInPixel[0][1]); j <= (this.coordInPixel[2][1]); j++) {
if(j > 0) {
mutableBm.setPixel(i, j, Color.rgb(255, 128, 0));
}
}
}
this.picture.setImageBitmap(mutableBm);
}
public static Bitmap convertToMutable(Bitmap imgIn) {
try {
File file = new File(Environment.getExternalStorageDirectory() + File.separator + "temp.tmp");
RandomAccessFile randomAccessFile = new RandomAccessFile(file, "rw");
int width = imgIn.getWidth();
int height = imgIn.getHeight();
Bitmap.Config type = imgIn.getConfig();
FileChannel channel = randomAccessFile.getChannel();
MappedByteBuffer map = channel.map(FileChannel.MapMode.READ_WRITE, 0, imgIn.getRowBytes()*height);
imgIn.copyPixelsToBuffer(map);
imgIn.recycle();
System.gc();
imgIn = Bitmap.createBitmap(width, height, type);
map.position(0);
imgIn.copyPixelsFromBuffer(map);
channel.close();
randomAccessFile.close();
file.delete();
...
return imgIn;
}
...
}

Related

Temple image detection not working correctly

I have a picture that contains 2 icons at the bottom of the picture i'm already croping the picture to get only the buttom and comparing it with the icon picture opencv temple image detecter it works perfectly when the icon is there but the problem is when i delete the icon still the rectangle appears and it appears in wrong place all i want if there is a match show the rectangle if there is not don't show it
here is my code
public class Test123 extends AppCompatActivity {
ImageView a,b,c;
String resultImgPath,baseDir,lol;
Button x;
private static final String TAG = "Test123";
String aa,bb;
static {
if(!OpenCVLoader.initDebug()){
Log.e(TAG, "OpenCV not loaded");
} else {
Log.e(TAG, "OpenCV loaded");
}
}
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_test123);
System.loadLibrary("opencv_java3");
a = (ImageView)findViewById(R.id.imageView);
b = (ImageView)findViewById(R.id.imageView2);
c = (ImageView)findViewById(R.id.imageView3);
x = (Button) findViewById(R.id.button);
baseDir = Environment.getExternalStorageDirectory().getAbsolutePath();
resultImgPath = baseDir+"/Test/result.jpg";
aa = baseDir+"/Test/d.jpg";
bb = baseDir+"/Test/dd1.jpg";
lol = baseDir+"/Test/c.jpg";
x.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View v) {
Bitmap bmImg = BitmapFactory.decodeFile(aa);
int fromHere = (int) (bmImg.getHeight() * 0.06);
final Bitmap croppedBitmap = Bitmap.createBitmap(bmImg, (int) (bmImg.getWidth() * 0.3), (int) (bmImg.getHeight() * 0.94), (int) (bmImg.getWidth() * 0.6), fromHere);
String root = Environment.getExternalStorageDirectory().toString();
File myDir = new File(root + "/Test");
myDir.mkdirs();
String fname = "c.jpg";
File file = new File(myDir, fname);
if (file.exists())
file.delete();
try {
FileOutputStream out = new FileOutputStream(file);
croppedBitmap.compress(Bitmap.CompressFormat.JPEG, 90, out);
out.flush();
out.close();
} catch (Exception e) {
e.printStackTrace();
}
a.setImageBitmap(croppedBitmap);
Bitmap bmImg2 = BitmapFactory.decodeFile(bb);
b.setImageBitmap(bmImg2);
matchingDemo(lol, bb, resultImgPath, Imgproc.TM_SQDIFF);
}
});
}
public void matchingDemo(String imgPath,String templatePath,String resPath, int matchType){
// to read the entered image from its path and make a mat object
Mat img = Imgcodecs.imread(imgPath);
Mat templ = Imgcodecs.imread(templatePath);
// Create the result matrix
int result_cols = img.cols() - templ.cols() + 1;
int result_rows = img.rows() - templ.rows() + 1;
Mat result = new Mat(result_rows, result_cols, CvType.CV_8UC3);
// performing matching and do normalization
Imgproc.matchTemplate(img, templ, result, matchType);
int type = Imgproc.THRESH_TOZERO;
Imgproc.threshold(result, result, 0.8, 1., type);
Core.normalize(result, result, 0, 1, Core.NORM_MINMAX, -1, new Mat());
// / finding the best match from minMaxLoc
Core.MinMaxLocResult mmr = Core.minMaxLoc(result);
double bb = mmr.maxVal;
Log.e("hey",bb+"");
Point matchLoc;
if (matchType == Imgproc.TM_SQDIFF || matchType == Imgproc.TM_SQDIFF_NORMED) {
matchLoc = mmr.minLoc;
} else {
matchLoc = mmr.maxLoc;
}
// draw a rectangle on searched object
Imgproc.rectangle(img, matchLoc, new Point(matchLoc.x + templ.cols(),
matchLoc.y + templ.rows()), new Scalar(0, 255, 0));
// store the result image here
Imgcodecs.imwrite(resPath, img);
Mat image = new Mat();
image =Imgcodecs.imread(resPath);
Bitmap bm = Bitmap.createBitmap(image.cols(),image.rows(), Bitmap.Config.ARGB_8888);
Utils.matToBitmap(image, bm);
c.setImageBitmap(bm);
image.release();
}
}
EDIT
i know that i need something here
if(......................)
Imgproc.rectangle(img, matchLoc, new Point(matchLoc.x + templ.cols(),
matchLoc.y + templ.rows()), new Scalar(0, 255, 0));
}
I tried to put minVal inside the if block but every picture gives me different numbers i tried with normalize and without it i can put the right number on 1 picture but other picture gives me different numbers so it is not detecting at all if the icon is visible or if it is not it givin the same issue drawing in wrong place i just need 1 number or something to draw if it is there to not draw if there is no match i don't want to have value if there is no match

How to display same image in ImageView if I click on the horizontal images in android

I have the list of images in horizontal LinearLayout If I click particular image the same image will appear on the above of single image view.
How can I get the position of Images in Image View.
CODE
JSONArray multipleimage = alertObj.getJSONArray(PRODUCT_IMAGES);
/*JSONObject singleimage = multipleimage.getJSONObject(Integer.parseInt("original_res"));
String singleimg = productpath + alertObj.getString("seller_id") + String.valueOf(singleimage);
firstimages=(ImageView)
findViewById(R.id.singleimage);
YelloPage.imageLoader.displayImage(singleimg,firstimages,options);*/
horizontalimage=(LinearLayout) findViewById(R.id.linearimage);
if(multipleimage.length()>0)
{
for (int j = 0; j < multipleimage.length(); j++) {
JSONObject pimages = multipleimage.getJSONObject(j);
JSONObject oneimage = multipleimage.getJSONObject(0);
ii = new ImageView(singleshooppingcart.this);
multipleimages = (ImageView) findViewById(R.id.singleimage);
ii.setScaleType(ImageView.ScaleType.FIT_CENTER);
LinearLayout.LayoutParams image = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
image.width = 150;
image.height = 150;
image.setMargins(5, 0, 0, 0);
String multimgs = pimages.getString("original_res");
String oneimg = oneimage.getString("original_res");
String[] img2 = multimgs.split("\\.");
String imagone = productpath + alertObj.getString("seller_id") + '/' + img2[0] + '(' + '2' + '0' + '0' + ')' + '.' + img2[1];
String singleiamges = productpath + alertObj.getString("seller_id") + '/' + oneimg;
YelloPage.imageLoader.displayImage(imagone, ii, options);
YelloPage.imageLoader.displayImage(singleiamges, multipleimages, options);
ii.setLayoutParams(image);
horizontalimage.addView(ii);
ii.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
}
});
}
}
How to solve this problem Thanks in Advance.
You can use many approaches for this-
Simplest approach is using ViewGroup#indexOfChild(View child) method. This will simply return what you want.
Or you can use View#setTag(Object) and View#getTag(), specially if you want to get some thing more than mere index in onClick.
You can also use View#setTag(int, Object) and View#getTag(int), if you want to set more than one tag per view.
Hope below example code for first approach helps-
ii.setOnClickListener(new View.OnClickListener()
{
#Override
public void onClick (View view){
// the parameter view here is your imageview, which is clicked.
// horizontalimage is your LinearLayout, which is a ViewGroup
int indexOfImage = horizontalimage.indexOfChild(view);
// do what you want to do with index
}
});
Not tested..try like this...
JSONArray multipleimage = alertObj.getJSONArray(PRODUCT_IMAGES);
/*JSONObject singleimage = multipleimage.getJSONObject(Integer.parseInt("original_res"));
String singleimg = productpath + alertObj.getString("seller_id") + String.valueOf(singleimage);
firstimages = (ImageView)findViewById(R.id.singleimage);
YelloPage.imageLoader.displayImage(singleimg,firstimages,options);*/
horizontalimage = (LinearLayout)findViewById(R.id.linearimage);
if(multipleimage.length()>0)
{
for (int j = 0; j < multipleimage.length(); j++) {
JSONObject pimages = multipleimage.getJSONObject(j);
JSONObject oneimage = multipleimage.getJSONObject(0);
ii = new ImageView(singleshooppingcart.this);
multipleimages = (ImageView) findViewById(R.id.singleimage);
ii.setScaleType(ImageView.ScaleType.FIT_CENTER);
LinearLayout.LayoutParams image = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
image.width = 150;
image.height = 150;
image.setMargins(5, 0, 0, 0);
String multimgs = pimages.getString("original_res");
String oneimg = oneimage.getString("original_res");
String[] img2 = multimgs.split("\\.");
String imagone = productpath + alertObj.getString("seller_id") + '/' + img2[0] + '(' + '2' + '0' + '0' + ')' + '.' + img2[1];
String singleiamges = productpath + alertObj.getString("seller_id") + '/' + oneimg;
YelloPage.imageLoader.displayImage(imagone, ii, options);
YelloPage.imageLoader.displayImage(singleiamges, multipleimages, options);
ii.setLayoutParams(image);
horizontalimage.addView(ii);
ii.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
multipleimages.setImageURI (singleiamges);
}
});
}
}

save image in db erro & decodeByteArray give null

I am trying to download image and save it to db i download it and save i to BLOB field when want to retrieve it it get me null value.I search a lot and examine lots of things but I have no idea where is the problem :( .
save image part :
MyDataBase = new MyDatabase(this);
mydb = MyDataBase.getWritableDatabase();
byte[] tempval;
for (int j = 0; j < myarray.arrtitle.length; j++)
{
tempval = saveimage(myarray.arrpic.get(j),myarray.arrpath[j]);
mydb.execSQL("INSERT INTO news (title,content,image) VALUES (\"" + myarray.arrtitle[j] +
"\",\"" + myarray.arrcontent[j] + "\",\"" + tempval + "\")");
}
mydb.close()
saveimage() function :
try {
////////////////get bitmap to byte
ByteArrayOutputStream bos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, bos);
byte[] image = bos.toByteArray();
return image;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
read from db:
try
{
String temp = null;
Bitmap tempbit = null;
ArrayList<Bitmap> tempbit2 = new ArrayList<Bitmap>();
ArrayList<String> tempstring = new ArrayList<String>();
MyDataBase = new MyDatabase(this);
mydb = MyDataBase.getReadableDatabase();
Cursor cu = mydb.rawQuery("SELECT * FROM news",null);
cu.moveToFirst();
for (int i = 0;i<cu.getCount();i++)
{
temp = cu.getString(cu.getColumnIndex("title"));
byte[] imag = cu.getBlob(cu.getColumnIndex("image"));
tempbit = BitmapFactory.decodeByteArray(imag, 0, imag.length); // i get null here
tempbit2.add(tempbit);
tempstring.add(temp);
cu.moveToNext();
Toast.makeText(getApplicationContext(), "" + tempbit + i, Toast.LENGTH_LONG).show();
}
////////////////////////////show in list view
ListViewAdapte adapter = new ListViewAdapte(Description.this, R.layout.listview, tempstring , tempbit2);
MyList.setAdapter(adapter);
MyList.setOnItemClickListener(this);
} catch (Exception e) {
// TODO: handle exception
Toast.makeText(getApplicationContext(), "error on load from db", Toast.LENGTH_LONG).show();
}
When I Toast tempbit it gets me null
i should save picture as contentview
ContentValues tempval = new ContentValues();
for (int j = 0; j < myarray.arrtitle.length; j++)
{
mydb.execSQL("INSERT INTO news (title,content) VALUES (\"" + myarray.arrtitle[j] +
"\",\"" + myarray.arrcontent[j] + "\"" + ")");
}
for (int j = 0; j < myarray.arrpic.size(); j++)
{
tempval = saveimage(myarray.arrpic.get(j),myarray.arrpath[j]);
update ="title ='" + myarray.arrtitle[j] + "'" ;
mydb.update("news", tempval,update, null);
}
save image is possible with using contentview :)

Google Maps API Android - Tile provider's tiles resolution

I'm using custom TileProviders in my Android app to display offline maps and OpenStreetMap maps. It works, but there is a problem with the tiles resolution, which is quite bad. The files have a size of 256x256, and setting the width/height of my TileProvider to 128 doesn't change anything.
Here is some piece of code :
public class GenericUrlTileProvider extends UrlTileProvider {
// ---------------------------------------------------------------------------------------
// Private attributes :
private String _baseUrl;
// ---------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------
// Constructor :
public GenericUrlTileProvider(int width, int height, String url) {
super(width, height);
this._baseUrl = url;
}
#Override
public URL getTileUrl(int x, int y, int zoom) {
try {
return new URL(_baseUrl.replace("{z}", "" + zoom).replace("{x}", "" + x).replace("{y}", "" + y));
}
catch (MalformedURLException e) { e.printStackTrace(); }
return null;
}
// ---------------------------------------------------------------------------------------
}
Does anyone know how to fix this to support high resolution devices ?
Thanks
On #grub request, here is what I did for getting the 4 tiles of the next zoom level :
public Tile getTileFromNextZoomLevel(int x, int y, int zoom) {
final String topLeftTileUrl = _source.getUrlSchema().replace("{z}", "" + (zoom + 1)).replace("{x}", "" + (x * 2)).replace("{y}", "" + (y * 2));
final String topRightTileUrl = _source.getUrlSchema().replace("{z}", "" + (zoom + 1)).replace("{x}", "" + (x * 2 + 1)).replace("{y}", "" + (y * 2));
final String bottomLeftTileUrl = _source.getUrlSchema().replace("{z}", "" + (zoom + 1)).replace("{x}", "" + (x * 2)).replace("{y}", "" + (y * 2 + 1));
final String bottomRightTileUrl = _source.getUrlSchema().replace("{z}", "" + (zoom + 1)).replace("{x}", "" + (x * 2 + 1)).replace("{y}", "" + (y * 2 + 1));
final Bitmap[] tiles = new Bitmap[4];
Thread t1 = new Thread() {
#Override
public void run() { tiles[0] = Utils.getBitmapFromURL(topLeftTileUrl); }
};
t1.start();
Thread t2 = new Thread() {
#Override
public void run() { tiles[1] = Utils.getBitmapFromURL(topRightTileUrl); }
};
t2.start();
Thread t3 = new Thread() {
#Override
public void run() { tiles[2] = Utils.getBitmapFromURL(bottomLeftTileUrl); }
};
t3.start();
Thread t4 = new Thread() {
#Override
public void run() { tiles[3] = Utils.getBitmapFromURL(bottomRightTileUrl); }
};
t4.start();
try {
t1.join();
t2.join();
t3.join();
t4.join();
}
catch (InterruptedException e) { e.printStackTrace(); }
byte[] tile = Utils.mergeBitmaps(tiles, Bitmap.CompressFormat.JPEG); // PNG is a lot slower, use it only if you really need to
return tile == null ? TileProvider.NO_TILE : new Tile( (int) _source.getTileSize().getWidth(), (int) _source.getTileSize().getHeight(), tile);
}
And the Utils methods :
public static byte[] mergeBitmaps(Bitmap[] parts, Bitmap.CompressFormat format) {
// Check if all the bitmap are null (if so return null) :
boolean allNulls = true;
for (int i = 0; i < parts.length; i++) {
if(parts[i] != null) {
allNulls = false;
break;
}
}
if(allNulls) return null;
Bitmap tileBitmap = Bitmap.createBitmap(512, 512, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(tileBitmap);
Paint paint = new Paint();
for (int i = 0; i < parts.length; i++) {
if(parts[i] == null) {
parts[i] = Bitmap.createBitmap(256, 256, Bitmap.Config.ARGB_8888);
}
canvas.drawBitmap(parts[i], parts[i].getWidth() * (i % 2), parts[i].getHeight() * (i / 2), paint);
}
ByteArrayOutputStream stream = new ByteArrayOutputStream();
tileBitmap.compress(format, 100, stream);
byte[] bytes = stream.toByteArray();
return bytes;
}
public static Bitmap getBitmapFromURL(String urlString) {
try {
// Ensure the file exists :
if(Utils.getResponseCode(urlString) != 200) return null;
URL url = new URL(urlString);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setDoInput(true);
connection.connect();
Bitmap bitmap = BitmapFactory.decodeStream(connection.getInputStream());
return bitmap;
}
catch (IOException e) { return null; }
}
You may have to adapt it for your needs. Please note that my app is still under development, and this code may need some tests / improvements.

How to display file size in list view with file name

file in my folder i have give path and display in list view but i want to in list file display with its size. i give you snippet code by this code i am get all file name in list view but i want to file name with its size in list plz help me.
String root_sd = Environment.getExternalStorageDirectory().toString();
file = new File( root_sd + "/recycle/" ) ;
File list[] = file.listFiles();
for( int i=0; i< list.length; i++)
{
myList.add( list[i].getName() );
}
setListAdapter(new ArrayAdapter<String>(this,
android.R.layout.simple_list_item_1, myList ));
setContentView(R.layout.main);
mFilePathTextView = (TextView)findViewById(R.id.file_path_text_view);
mStartActivityButton = (Button)findViewById(R.id.start_file_picker_button);
mStartActivityButton.setOnClickListener(this);
protected void onListItemClick(ListView l, View v, int position, long id)
{
super.onListItemClick(l, v, position, id);
final File temp_file = new File( file, myList.get( position ) );
AlertDialog alertbox = new AlertDialog.Builder(this)
.setTitle("File Detail")
.setMessage("File Name:"+temp_file)
.setPositiveButton("Delete",
new DialogInterface.OnClickListener() {
// do something when the button is clicked
public void onClick(DialogInterface arg0, int arg1) {
DeleteRecursive(temp_file);
refresh();
//mylist.invalidateViews();
//adapter.notifyDataSetChanged();
}
})
.setNegativeButton("Restore", new DialogInterface.OnClickListener() {
// do something when the button is clicked
public void onClick(DialogInterface arg0, int arg1) {
String s5=temp_file.toString();
String z1[]={"Field1","Field2"};
try
{
String from= temp_file.toString();
here my xml file******************************
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ListView
android:id="#+id/mylist"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#aa0000"
android:drawSelectorOnTop="false" />
i want to display file size in sub item plz give me solution what change in my xml file and code.
Do this way
This method will calculate the file size
public String readableFileSize(long size) {
if (size <= 0)
return "0";
final String[] units = new String[] { "B", "KB", "MB", "GB", "TB" };
int digitGroups = (int) (Math.log10(size) / Math.log10(1024));
return new DecimalFormat("#,##0.#").format(size / Math.pow(1024, digitGroups)) + " " + units[digitGroups];
}
In your code
for( int i=0; i< list.length; i++)
{
myList.add( list[i].getName() + " " + readableFileSize(list[i].length()));
}
see this..
import java.io.File;
public class FileSizeExample
{
public static void main(String[] args)
{
File file =new File("c:\\java_xml_logo.jpg");
if(file.exists()){
double bytes = file.length();
double kilobytes = (bytes / 1024);
double megabytes = (kilobytes / 1024);
double gigabytes = (megabytes / 1024);
double terabytes = (gigabytes / 1024);
double petabytes = (terabytes / 1024);
double exabytes = (petabytes / 1024);
double zettabytes = (exabytes / 1024);
double yottabytes = (zettabytes / 1024);
System.out.println("bytes : " + bytes);
System.out.println("kilobytes : " + kilobytes);
System.out.println("megabytes : " + megabytes);
System.out.println("gigabytes : " + gigabytes);
System.out.println("terabytes : " + terabytes);
System.out.println("petabytes : " + petabytes);
System.out.println("exabytes : " + exabytes);
System.out.println("zettabytes : " + zettabytes);
System.out.println("yottabytes : " + yottabytes);
}else{
System.out.println("File does not exists!");
}
}
}
Here, to calculate the size in number of bytes
AssetManager manager = getAssets();
InputStream in= null;
try {
in= manager.open("pic.png");
Bitmap bitmap = BitmapFactory.decodeStream(in);
int bt = in.available(); // here is the size in no. of byte
ImageView imgView= (ImageView) findViewById(R.id.imageView01);
imgView.setImageBitmap(bitmap);
} catch (IOException e) {
e.printStackTrace();
}

Categories

Resources