7,10d6 < import android.content.Context; < import android.content.res.Resources; < import android.graphics.Bitmap; < import android.graphics.BitmapFactory; 16,17d11 < import android.widget.ImageView; < import android.widget.Toast; 43d36 < public static boolean isfirstchange = true; 64,72d56 < < Context context = getApplicationContext(); < CharSequence text = "Toggle the image and mix it up (that little bit) with the toggle button"; < int duration = Toast.LENGTH_LONG; < < Toast toast = Toast.makeText(context, text, duration); < toast.show(); < < 115,131d98 < < //setContentView(R.id.imageView1); < //ImageView image = (ImageView) findViewById(R.drawable.weatherintegration); < //setContentView(image); < ImageView image = (ImageView) findViewById(R.id.imageView1); < // image.setImageResource(R.drawable.weatherintegration); < //Bitmap bImage = BitmapFactory.decodeResource(this.getResources(), R.drawable.weatherintegration); < Resources res = getResources(); < int id = R.drawable.integrationweather; < if (!isfirstchange) { < id = R.drawable.weatherintegration; < isfirstchange = true; < } else { < isfirstchange = false; < } < Bitmap bImage = BitmapFactory.decodeResource(res, id); < image.setImageBitmap(bImage); 133c100 < }); --- > }); 145,149d111 < < //private Resources getResources() { < // TODO Auto-generated method stub < // return null; < //} 177,196d138 < < ImageView image = (ImageView) findViewById(R.id.imageView1); < Resources res = getResources(); < int id = R.drawable.integrationweather; < //Context context = getApplicationContext(); < //CharSequence text = "Hello toast! " + motionEvent.getAction(); < //int duration = Toast.LENGTH_SHORT; < < //Toast toast = Toast.makeText(context, text, duration); < //toast.show(); < if (motionEvent.getAction() == 0) { < if (!isfirstchange) { < id = R.drawable.weatherintegration; < isfirstchange = true; < } else { < isfirstchange = false; < } < } < Bitmap bImage = BitmapFactory.decodeResource(res, id); < image.setImageBitmap(bImage);