@Override
public void onClick(View v) {
try {
//Write fileObject tag = imageView.getTag();
//Bitmap bmp = BitmapFactory.decodeResource(getResources(),R.drawable.c);
Bitmap bmp= BitmapFactory.decodeResource(getResources(),v.getResources().getResourceName((Integer)v.getTag()));
String filename = "bitmap.png";
FileOutputStream stream = getApplicationContext().openFileOutput(filename, Context.MODE_PRIVATE);
bmp.compress(Bitmap.CompressFormat.PNG, 100, stream);
//Cleanup
stream.close();
bmp.recycle();
i want to add the image id from viewPager instead of the R.drawable.img1, any1 please any help? i have edited my question, instaed of getting image from drawable i need to get ithe current image on viewPager. how do i do it?