toast

Android Custom Toast Tutorial

AndroidPeople.com - Going to see how to display a textview in toast using setView() & some more properties of Toast - Custom Toast Notification.

Android Gallery Example

In android, we can show multiple image in gallery view. Here is a android gallery example that will explain how to show the images in gallery view.
Example for Android Gallery :-
Create a attrs.xml file in res/values folder.

Android DatePicker Dialog Example

Now we can display android datepicker dialog box in all android mobile phones.

Example for Android Datepicker Dialog :

[sourcecode language="java"]
public class ExampleApp extends Activity implements Button.OnClickListener {
private Button b1;
static final int DATE_DIALOG_ID = 0;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
// Adding button to the layout
b1=(Button)findViewById(R.id.Button01);
b1.setOnClickListener(this);
}
// Creating dialog
@Override
protected Dialog onCreat

Android Toast Example

Android allows us to display a message without any button like 'OK' or 'Cancel'.

Its helps us to display a short message in short time.

Toast Example :

[sourcecode language="java"]

Toast.makeText(Classname.this, "Your Toast Text", Toast.LENGTH_SHORT).show();

[/sourcecode]

The output will look like

toastmeessage without any button.

Look at the

Syndicate content