android-image
Remove the SearchIcon as hint in the searchView
In my app i’ve used android.support.v7.widget.SearchView and to hide search icon this worked for me : <android.support.v7.widget.SearchView … app:iconifiedByDefault=”false” app:searchIcon=”@null” />
Access pictures from Pictures app in my android app
You can usestartActivityForResult, passing in an Intent that describes an action you want completed and and data source to perform the action on. Luckily for you, Android includes an Action for picking things: Intent.ACTION__PICK and a data source containing pictures: android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI for images on the local device or android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI for images on the SD card. … Read more
How to display a list of images in a ListView in Android?
I’d start with something like this (and if there is something wrong with my code, I’d of course appreciate any comment): public class ItemsList extends ListActivity { private ItemsAdapter adapter; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.items_list); this.adapter = new ItemsAdapter(this, R.layout.items_list_item, ItemManager.getLoadedItems()); setListAdapter(this.adapter); } private class ItemsAdapter extends ArrayAdapter<Item> { private Item[] items; … Read more
About Android image and asset sizes
mdpi is the reference density — that is, 1 px on an mdpi display is equal to 1 dip. The ratio for asset scaling is: ldpi | mdpi | tvdpi | hdpi | xhdpi | xxhdpi | xxxhdpi 0.75 | 1 | 1.33 | 1.5 | 2 | 3 | 4 Although you don’t really … Read more
Open an image using URI in Android’s default gallery image viewer
Accepted answer was not working for me, What had worked: Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setDataAndType(Uri.parse(“file://” + “/sdcard/test.jpg”), “image/*”); startActivity(intent);
Android Text over image
That is how I did it and it worked exactly as you asked for inside a RelativeLayout: <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:id=”@+id/relativelayout” android:layout_width=”fill_parent” android:layout_height=”fill_parent” > <ImageView android:id=”@+id/myImageView” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:src=”https://stackoverflow.com/questions/5242951/@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>
Reading an image file into bitmap from sdcard, why am I getting a NullPointerException?
The MediaStore API is probably throwing away the alpha channel (i.e. decoding to RGB565). If you have a file path, just use BitmapFactory directly, but tell it to use a format that preserves alpha: BitmapFactory.Options options = new BitmapFactory.Options(); options.inPreferredConfig = Bitmap.Config.ARGB_8888; Bitmap bitmap = BitmapFactory.decodeFile(photoPath, options); selected_photo.setImageBitmap(bitmap); or http://mihaifonoage.blogspot.com/2009/09/displaying-images-from-sd-card-in.html