How to highlight ImageView when focused or clicked?

You need to assign the src attribute of the ImageView a state list drawable. In other words, that state list would have a different image for selected, pressed, not selected, etc. – that’s how the Twitter App does it. So if you had an ImageView: <ImageView style=”@style/TitleBarLogo” android:contentDescription=”@string/description_logo” android:src=”https://stackoverflow.com/questions/4185930/@drawable/title_logo” /> The src drawable (title_logo.xml) would … Read more

Adding text to ImageView in Android

To add a text to your ImageView you can do this: <RelativeLayout> // Only works inside a RelativeLayout <ImageView android:id=”@+id/myImageView” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:src=”https://stackoverflow.com/questions/3404582/@drawable/myImageSouce” /> <TextView android:id=”@+id/myImageViewText” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_alignLeft=”@+id/myImageView” android:layout_alignTop=”@+id/myImageView” android:layout_alignRight=”@+id/myImageView” android:layout_alignBottom=”@+id/myImageView” android:layout_margin=”1dp” android:gravity=”center” android:text=”Hello” android:textColor=”#000000″ /> </RelativeLayout>

I want to transfer the image from one activity to another

In your first Activity Convert ImageView to Bitmap imageView.buildDrawingCache(); Bitmap bitmap = imageView.getDrawingCache(); Intent intent = new Intent(this, NewActivity.class); intent.putExtra(“BitmapImage”, bitmap); In second Activity Bitmap bitmap = (Bitmap) intent.getParcelableExtra(“BitmapImage”); Then display bitmap in ImageView. Note: this is not recommended. Should actually save the image somewhere and pass the path instead and retrieve from second activity.

Android Drop Shadow on View

You could use a combination of Bitmap.extractAlpha and a BlurMaskFilter to manually create a drop shadow for any image you need to display, but that would only work if your image is only loaded/displayed once in a while, since the process is expensive. Pseudo-code (might even compile!): BlurMaskFilter blurFilter = new BlurMaskFilter(5, BlurMaskFilter.Blur.OUTER); Paint shadowPaint … Read more