Advertisement
gobuhl07

Activity

Feb 2nd, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. package com.tim.rickers.formelerkennung;
  2.  
  3. import java.io.File;
  4. import java.io.IOException;
  5.  
  6. import android.app.Activity;
  7. import android.graphics.Bitmap;
  8. import android.graphics.BitmapFactory;
  9. import android.graphics.Canvas;
  10. import android.graphics.Paint;
  11. import android.graphics.PorterDuff.Mode;
  12. import android.graphics.PorterDuffXfermode;
  13. import android.os.Bundle;
  14. import android.support.v7.app.ActionBarActivity;
  15. import android.view.Menu;
  16. import android.view.MenuItem;
  17. import android.widget.ImageView;
  18. import android.widget.RelativeLayout;
  19.  
  20. import java.io.*;
  21. import java.awt.*;
  22.  
  23.  
  24.  
  25.  
  26.  
  27. public class BildAnzeigen extends ActionBarActivity {
  28.  
  29. @Override
  30. protected void onCreate(Bundle savedInstanceState) {
  31. super.onCreate(savedInstanceState);
  32. setContentView(R.layout.activity_bild_anzeigen);
  33.  
  34.  
  35. }
  36.  
  37. @Override
  38. public boolean onCreateOptionsMenu(Menu menu) {
  39. // Inflate the menu; this adds items to the action bar if it is present.
  40. getMenuInflater().inflate(R.menu.bild_anzeigen, menu);
  41. return true;
  42. }
  43.  
  44. @Override
  45. public boolean onOptionsItemSelected(MenuItem item) {
  46. // Handle action bar item clicks here. The action bar will
  47. // automatically handle clicks on the Home/Up button, so long
  48. // as you specify a parent activity in AndroidManifest.xml.
  49. int id = item.getItemId();
  50. if (id == R.id.action_settings) {
  51. return true;
  52. }
  53. return super.onOptionsItemSelected(item);
  54. }
  55.  
  56.  
  57. String imageFileName =getIntent().getStringExtra("imageFileName");
  58. //String bildquelle = "R.drawable." + imageFileName;
  59.  
  60.  
  61. public class ImageChange extends Activity {
  62.  
  63. ImageView iv = new ImageView(this);
  64. String bildquelle = "R.drawable." + imageFileName;
  65. int id = getResources().getIdentifier(bildquelle, "drawable", getPackageName());
  66.  
  67.  
  68. Bitmap bMap = BitmapFactory.decodeResource(getResources(), id);
  69. //Bitmap bMap = BitmapFactory.decodeFile("/res/drawable/" + imageFileName);
  70. iv.setImageBitmap(bMap);
  71.  
  72.  
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement