Terms and conditions
Preamble:
This Agreement, signed on Jun 10, 2012 [hereinafter: Effective Date] governs the relationship between the Enduser, a private person, (hereinafter: Licensee) and Paul N...
If you think the Android project Operation-Valkyrie listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package valkyrie.ui.gallery;
/*www.java2s.com*/import valkyrie.file.DecodeBitmaps;
import valkyrie.main.R;
import valkyrie.widget.TouchImageView;
import android.app.Activity;
import android.content.Intent;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;
/**
*
* COPYRIGHT: Paul Neuhold, Laurenz Theuerkauf, Alexander Ritz, Jakob
* Schweighofer, Milo Tischler ? Milo Tischler, Jakob Schweighofer, Alexander
* Ritz, Paul Neuhold, Laurenz Theuerkauf
*
*//**
* ShowPicActivity is started when we click on a Item on the Gridview in the
* GalleryActivity Creates then a imageview casted from TouchImageView which
* handles the displaying in the new Activity
*
*/publicclass ShowPicActivity extends Activity {
privatestaticfinal String TAG = "ShowPicActivity";
@Override
publicvoid onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.showpic);
Intent intent = getIntent();
TouchImageView imageView = (TouchImageView) this
.findViewById(R.id.full_image_view);
int position = intent.getExtras().getInt("id");
BitmapFactory.Options scaleBitmapOpt = new BitmapFactory.Options();
scaleBitmapOpt.inSampleSize = 2;
try {
Log.d(TAG, "trying displaying image without compressing");
imageView.setImageBitmap(BitmapFactory
.decodeFile(DecodeBitmaps.fullImgPosition.get(position)));
} catch (OutOfMemoryError e) {
e.printStackTrace();
scaleBitmapOpt.inSampleSize = 4;
imageView
.setImageBitmap(BitmapFactory.decodeFile(
DecodeBitmaps.fullImgPosition.get(position),
scaleBitmapOpt));
Toast.makeText(
this.getApplicationContext(),
"Something went wrong while loading the Pic, please try again",
Toast.LENGTH_LONG).show();
}
}
}