Iced Tea Labs Share to be shared

ListView Dialog

First of all, I’ll show you the result of this post to give you some motivation As usual, you need to create the layout in main.xml file Create layout for your List View Dialog my_list.xml Coding time! In the  onCreate method, we need to: Load all the components and controls in the  main.xml layout. Create an AlertDialog objec... Read more

Custom List View

A - Introduction ListView is a very important control in Android programming. Almost every apps has ListView. ListView doesn’t only contain text but also other controls like ImageView, Button, Checkbox… This post will show you how to customize a ListView. B - Step by step demo First of all, we must add a ListView into main layout (main.xml f... Read more

Tab Layout

A - Introduction about Tab Layout To implement the content of a tab, we have 2 ways: Using tab to navigate among views in a same activity Using tab to navigate among activities In this post, I’ll show you the second way. B - Step by step demo Firstly, create a new project named TabLayout Next, create 3 different activities: ArtistActivity... Read more

2D Graphic in Android

I - Introduction 2D Graphic in Android In Android, to draw anything you always need 4 basic components: An object type Bitmap to hold all the pixels you need to draw An object hold all the drawing stroke (Rect, Path, Bitmap,...) An object type Paint to define the color, style for your result An object type Canvas to operate drawing command ... Read more

Custom Button

Sometime, you don’t want to use provided buttons style of Android like this: You want something’s special, an GUI in your own and unique style. In this post, we will create a custom button using basic Button control and XML file that defines 3 different states of the button: normal, focused and pressed. First, copy 3 images below into res/d... Read more

Custom Radio Button & Custom Checkbox

In previous post “Custom Button” we know how to customize a default Button of Android. Similarly, in this post, I will show you the way to customize default Radio Button and Checkbox using XML file and desired images. Copy these images to res/drawable folder: Define an XML file to specify desired appearance for each state of Radio Button: ... Read more

Use Existing SQLite Database in Android App

In my previous post about SQLite , I only post the way to create database when application started. In reality, we do not only need a database to store data but also need one to read information from. So, in this post, I will show you how to use existing SQLite database in Android app. The basic idea for this case is instead of creating a new... Read more


A - Introduction Fragment is some kind of “small Activity”. It can be embed into an Activity and reused in others. With Fragment, It’s easier for you to design multi-GUI for handset, tablet… Fragment has its own sets of views, life cycle and can interact with the parent Activity. B - Fragment life cycle Fragment life cycle is affected dire... Read more

Custom Toast

A toast is a view containing a quick little message for the user. It will never receive focus and will be dismiss after a specific time. By default, if you want to call a simple Toast, all you need is just one line of code: Toast.makeText(context, text, duration).show(); And you will get the result like this: More than that, this entry will ... Read more

Custom Dialog

You are developing an Android app and you don’t want to use the default dialog like this: You want something is unique and customizable like this: This post will guide you how to create a custom dialog in Android! Firstly, create an XML layout for your custom dialog: <RelativeLayout xmlns:android=" Read more