0% found this document useful (0 votes)
74 views70 pages

Handling Android Menu Events

Uploaded by

abdulelah.ak1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views70 pages

Handling Android Menu Events

Uploaded by

abdulelah.ak1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Mobile

Application
Development
CHAPTER 4
Course Outcome
Apply various events handling processes on appropriate android
widgets for user interaction.
Event Handling
Events are a useful way to collect data about a user's interaction with interactive
components of Applications. Like button presses or screen touch etc. The Android
framework maintains an event queue as first-in, first-out (FIFO) basis. You can
capture these events in your program and take appropriate action as per
requirements.
Android Event Management
•Event Listeners − An event listener is an interface in the View class that contains a single
callback method. This method will be called by the Android framework when the View to
which the listener has been registered is triggered by user interaction with the item in the UI.
•Event Listeners Registration − Event Registration is the process by which an Event
Handler gets registered with an Event Listener so that the handler is called when the Event
Listener fires the event.
•Event Handlers − When an event happens and we have registered an event listener for the
event, the event listener calls the Event Handlers, which is the method that actually handles
the event.
Event Listeners
& Event Event Handler Event Listener & Description
OnClickListener()
Handlers This is called when the user either clicks or touches
onClick() or focuses upon any widget like button, text, image
etc. You will use onClick() event handler to handle
such event.
OnLongClickListener()
This is called when the user either clicks or touches
onLongClick() or focuses upon any widget like button, text, image
etc. for one or more seconds. You will use
onLongClick() event handler to handle such event.

OnFocusChangeListener()
This is called when the widget looses its focus ie.
onFocusChange(
user goes away from the view item. You will use
)
onFocusChange() event handler to handle such
event.
OnKeyListener()
This is called when the user is presses or
releases a hardware key on the device.
onKey() You will use onKey() event handler to
Continue.. handle such event.

OnTouchListener()
This is called when the user presses the
key, releases the key, or any movement
onTouch() gesture on the screen. You will use
onTouch() event handler to handle such
event.

OnMenuItemClickListener()
This is called when the user selects a
onMenuItemClick() menu item. You will use
onMenuItemClick() event handler to
handle such event.
Continue….

onCreateContextMenuItemListener()
onCreateContextMenu() This is called when the context menu is
being built(as the result of a sustained
"long click)
OnClickListener()

[Link]() Step 1: Button specified in XML layout we want to


Interface definition for a
callback to be invoked when a process/handle
view is clicked.
onClick(View v): Called Step 2: Implement Event Handler
when a view has been clicked.
Inside this function you can
TWO OPTIONS – separate class to handle event(s), OR have t
specify what actions to containing the button do the event handling
perform on a click.
for a Button means implementing the [Link] in

Step 3: Register Event Handler


Code
public class MainActivity extends AppCompatActivity
{
Button bt;
@Override
protected void onCreate(Bundle
savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
bt=(Button)findViewById([Link]);
[Link](new
[Link](){
public void onClick(View v) {
// TODO Auto-generated method stub

[Link](getApplicationContext(), "Welcome",
Toast.LENGTH_LONG).show();
}

});
}

}
Touch Mode

Users can interact with their devices by using hardware keys or buttons or
touching the screen.

Touching the screen puts the device into touch mode. The user can then interact
with it by touching the on-screen virtual buttons, images, etc.

You can check if the device is in touch mode by calling the View class’s
isInTouchMode() method.
You can react to touch events in your custom views and your activities. Android
supports multiple pointers, e.g. fingers which are interacting with the screen. The
base class for touch support is the MotionEvent class which is passed to Views via the
onTouchEvent() method.
Continue…
When working on touch events we start by clicking a view and removing the gesture
(finger/stylus) then MotionEvent.ACTION_DOWN and MotionEvent.ACTION_UP is called
respectively.

When the initial touch happens on the ViewGroup and after intercepting when it moves to the
child, then MotionEvent.ACTION_CANCEL gets called on the ViewGroup and the touch event
dispatches to the children.

Now, everything depends on onInterceptTouchEvent() and its return value. Based on its return
value the dispatchTouchEvent is dependent, that if returns true the dispatcher is canceled, and
if it returns false then the dispatching of the touch event keeps going on until its used.

And onTouchEvent() if the return value is true, then it means the touch is handled and if it
returns false then it means the touch is not handled.
Coding

private LinearLayout r=null;


r=(LinearLayout)findViewById([Link]);
[Link](new [Link]() {
@Override
public boolean onTouch(View view, MotionEvent
motionEvent) {
return true;
}
Print the position of touch on
screen
public class MainActivity extends AppCompatActivity {
TextView t1;
private LinearLayout r=null;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
t1=(TextView)findViewById([Link]);
r=(LinearLayout)findViewById([Link]);
[Link](new [Link]() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
[Link](getApplicationContext(), "Welcome", Toast.LENGTH_LONG).show();
[Link]([Link]()+","+[Link]());
return true;
}
});

}
OnFocusChangeListener()

This is called when the widget looses its focus ie. user goes away from the
view item. You will use onFocusChange() event handler to handle such event.
public class MainActivity extends AppCompatActivity {
EditText t1,t2,t3;
@Override
protected void onCreate(Bundle
savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);

t2=(EditText)findViewById([Link]
2);
[Link](new
[Link]() {
@Override
public void onFocusChange(View view,
boolean b) {
[Link]("Focus is Changed");
}
});
}
}
KeyListener
[Link](new [Link]() {
@Override
public boolean onKey(View view, int i, KeyEvent
keyEvent) {
if ((i == KeyEvent.KEYCODE_ENTER)) {
//coding
return true;
} else
return false;
}
});
Change the colour of edit Text
when enter key pressed
EditText t1,t2;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
// v=new LinearLayout(this);
t1=findViewById([Link]);
t2=findViewById([Link]);
[Link](new [Link]() {
@Override
public boolean onKey(View view, int i, KeyEvent keyEvent) {
if ((i == KeyEvent.KEYCODE_ENTER)) {
[Link]();
[Link]([Link]);
return true;
} else
return false;
}
});

}
}
Menus in Android

In android, Menu is an important part of UI component which is used to provide


some common functionality around the application. A good menu adds more
capabilities to the app without occupying much space on the app’s UI.

Menus can be adjusted to the currently displayed UI.

Each screen may have its own set of options.

A screen could have any number of widgets and you may optionally attach a
menu to any of those widgets.
Types of Menu
1. Option Menu
2. Context Menu
3. Popup Menu

Options menu : The options menu is the primary


collection of menu items for an activity.

E.g. : ‘Search’, ‘Compose email’, and ‘Settings’.


Types of Menu…
Context Menu : Android context menu appears
when user press long click on the element. It is also
known as floating menu.
Popup menu : A popup menu displays a list of items
in a vertical list that is anchored to the view that
invoked the menu.
Menu in Android
Android Studio provides a standard XML format for type of menus to define menu items. We
can simply define the menu and all its items in XML menu resource instead of building the
menu in the code and also load menu resource as menu object in the activity or fragment
used in our android application. You can then inflate the menu resource (load it as
a Menu object) in your activity.
Menu in Android
Android Option Menus are the primary menus of android. They can be used for
settings, search, delete item etc.

Here, we are inflating the menu by calling the inflate() method


of MenuInflater class in the boolean onCreateOptionsMenu(Menu m)
method.

To perform event handling on menu items, you need to


override onOptionsItemSelected(MenuItem m1) method of Activity class.
Menu: outline
1. They appear whenever the user presses the menu button
2. Useful for giving different options without leaving the current
Activity
3. Suggestion: Don’t make too big menus, or they’ll cover
entirely the Activity
Create Menu folder
In android, to define options menu, we need to create a new folder menu inside
of our project resource directory (res/menu/) and add a new XML
(menu_example) file to build the menu.

Right click on resNewAndroid Resource Directory set resource type Menu and
click OK
Steps
Step 1: Open an Activity Class

Step 2: Create a Resources Folder

Step 3: Create a Menu XML File

Step 4: Add Items to Your Menu

Step 5: Create Icons for Your Menu Items

Step 6: Inflate Your Menu Resource

Step 7: Detect User Interaction

Step 8: Respond to Menu Item Selection


Create XML file for menu
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="[Link]
<item android:id="@+id/mail"
android:icon="@drawable/ic_mail"
android:title="@string/mail" />
<item android:id="@+id/upload"
android:icon="@drawable/ic_upload"
android:title="@string/upload"
android:showAsAction="ifRoom" />
<item android:id="@+id/share"
android:icon="@drawable/ic_share"
android:title="@string/share" />
</menu>
Load Android Options Menu from
an Activity
public boolean onCreateOptionsMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
[Link](menu, v, menuInfo);
MenuInflater inflater = getMenuInflater();
[Link]([Link].menu_example, menu);

Return true;
}
Handle Android Options Menu
Click Events
public boolean onOptionsItemSelected(MenuItem item) {
switch ([Link]()) {
case [Link]:
// do something
return true;
case [Link]:
// do something
return true;
default:
return [Link](item);
}
}
Example

<?xml version="1.0" encoding="utf-8"?>


<menu xmlns:android="[Link]
<item android:id="@+id/item1"
android:title="Item 1"
android:icon="@android:drawable/btn_star"/>
<item android:id="@+id/item2"
android:title="Item 2"
android:icon="@android:drawable/btn_plus"/>
<item android:id="@+id/item3"
android:title="Item 3"
android:icon="@android:drawable/btn_plus"/>
</menu>
Coding
public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater m;
m = getMenuInflater();
[Link]([Link].menu11,menu);
return true;
}
public boolean onOptionsItemSelected(MenuItem item) {
int id = [Link]();
switch (id){
case [Link].item1:
[Link](getApplicationContext(),"Item 1 Selected",Toast.LENGTH_LONG).show();
return true;
case [Link].item2:
[Link](getApplicationContext(),"Item 2 Selected",Toast.LENGTH_LONG).show();
return true;
case [Link].item3:
[Link](getApplicationContext(),"Item 3 Selected",Toast.LENGTH_LONG).show();
return true;
default:
return [Link](item);
}
}

}
PopUp Menu
In android, Popup Menu displays a list of items in a modal popup window that is
anchored to the view. The popup menu will appear below the view if there is a
room or above the view in case if there is no space and it will be closed
automatically when we touch outside of the popup.

The android Popup Menu provides an overflow style menu for actions that are
related to specific content.
Implement
Popup in
Android
Create Menu
folder and popup
menu file in Res
<?xml version="1.0" encoding="utf-8"?
>

<menu
xmlns:android="[Link]
com/apk/res/android">

<item android:id="@+id/one"

android:title="One" />

<item android:id="@+id/two"

android:title="Two"/>

<item android:id="@+id/three"

android:title="Three"/>

</menu>
public class MainActivity extends AppCompatActivity {

Button b1;

protected void onCreate(Bundle savedInstanceState) {

[Link](savedInstanceState);

setContentView([Link].activity_main);

b1=(Button)findViewById([Link]);

[Link](new [Link]() {

public void onClick(View view) {

Main PopupMenu popup = new PopupMenu([Link], b1);

Activity
//Inflating the Popup using xml file

[Link]().inflate([Link], [Link]());

//registering popup with OnMenuItemClickListener

[Link](new [Link]() {

public boolean onMenuItemClick(MenuItem item) {

[Link]([Link],"You Clicked : " + [Link](),


Toast.LENGTH_SHORT).show();

return true;

} }); [Link]();

} }); }}
TOAST
A toast provides simple feedback about an operation
in a small popup. It only fills the amount of space
required for the message and the current activity
remains visible and interactive. Toasts automatically
disappear after a timeout.

For example, clicking Send on an email triggers a


"Sending message..." toast, as shown in the following
screen capture:

Toasts are not clickable. If user response to a status


message is required, consider instead using a
Notification.
Toast: Continue..

Tiny messages over the Activity


A toast provides simple feedback about an
operation, in a small popup.
Used to signal to the user confirmation, little errors
Can control the duration of the Toast
simple
[Link](getApplicationContext(),"Item 1
Selected",Toast.LENGTH_LONG).show();
Intents

Intents are like messages that activate software components (activities, services,
broadcast receivers)

An Intent may be explicit when it has exactly one target or implicit otherwise: it
just specifies the action the component should provide.

An intent can also be pending, meaning that some component will be activated in
the future

It can be broadcast when it announces something to broadcast receivers


Intent….
Connect one activity to another
using Intent
Intent i=new Intent([Link], [Link]);

startActivity(i);
Fragments
Fragment represents a behavior or a portion of UI in an Activity. It is a kind of sub-
activity.

Multiple fragments can be combined in a single activity to build a multi-pane UI


and reuse a fragment in multiple activities.

You can add or remove fragments in an activity while activity is running.

An activity can contain any number of fragments.


Main Building Blocks – Fragments
• Fragment life cycle is closely related to lifecycle of its host activity which
means when activity is paused, all fragments available in activity will also
be stopped.
• Fragments were added to Android API in Honeycomb(3.0) version of
Android which API version 11.
• Earlier we had a limitation because we can show only a single activity on
screen at one given point in time. So we were not able to divide device
screen and control different parts separately.
• But with fragment we got more flexibility and removed limitation of
having a single activity on screen at a time. Fragments will have their
own layout, events and complete lifecycle.
• You create fragments by extending Fragment class and you can insert a
fragment into your activity layout by declaring fragment in activity's
layout file, as a <fragment> element.
Main Building Blocks – Fragments
Main Building Blocks – Fragment Lifecycle
Phase I: When a fragment gets created, it goes through following
states:
• onAttach() // when a frag is attached to its hosting
activity
• onCreate() //frag is initialized, but no UI
• onCreateView() //frag sets up and returns its UI. This
view is given to hosting activity afterwards.
• onActivityCreated() // Now frag’s life cycle is depending
upon its hosting activity’s life cycle
Phase II: When fragment becomes visible, it goes through these
states:
• onStart() //hosting activity is about to become
visible
• onResume() // hosting activity is about to become
visible and ready for user interaction
Phase III: When fragment goes into background mode, it goes
through this states.
• onPaused() //hosting activity is visible, but another
Main Building Blocks – Fragment Lifecycle
Phase IV: When fragment is destroyed, it goes through
following states:
• onPaused()
• onStop()
• onDestroyView() //hosting activity is about to be
destroyed any frag that it is hosting also has to be shut
down
• onDestroy() //release frag resources
• onDetach() //null out references to hosting
activity
Adding Fragments to Activities
Two general ways
1. First,
i. Fragment can be statically added to the activity’s
layout file.
ii. It is then used in a call to setContentView method.
2. Second,
Main Building Blocks – How to use Fragments?

This involves number of simple steps to create Fragments.


• First of all decide how many fragments you want to use in an activity. For
example let's we want to use two fragments to handle landscape and
portrait modes of the device.
• Next based on number of fragments, create classes which will extend
the Fragment class. Fragment class has above mentioned callback
functions. You can override any of the functions based on your
requirements.
• Corresponding to each fragment, you will need to create layout files in
XML file. These files will have layout for the defined fragments.
• Finally modify activity file to define actual logic of replacing fragments
based on your requirement.
Fragment
Implementation
Main Activity
public class MainActivity extends AppCompatActivity {
Button b1,b2;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
b1=(Button)findViewById([Link]) ;
b2=(Button)findViewById([Link].button3) ;
[Link](new [Link]() {
@Override
public void onClick(View view) {
frag1 f=new frag1();
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
[Link]([Link], f);
[Link]();
}
});
[Link](new [Link]() {
@Override
public void onClick(View view) {
frag2 f2=new frag2();
FragmentTransaction ft2 = getSupportFragmentManager().beginTransaction();
[Link]([Link], f2);
[Link]();
}
});
A notification is a message that can be displayed
to the user, outside of the user interface of an
application.

To see the details of the notification, the user


opens the notification drawer.

Both the notification area and the notification


drawer, are system-controlled areas that the user
can view at any time.
Android: Status Bar Notifications

 Used by background services to notify the occurrence of an


event that requires a response … without interrupting the
operations of the foreground activities!

 Display an icon on
the Status Bar (top screen)

Display a message in
the Notification Window

Fire an event in case


the user selects the
notification
54
Android: Status Bar Notifications

STATUS BAR
Notification

 Icon for the status bar


 Title and message
 PendingIntent to be
fired when notification is
Notification Manager
selected
OPTIONs:
Android system component  Ticket-text message
Responsible for notification management  Alert-sound
And status bar updates  Vibrate setting
 Flashing LED setting
 Customized layout

55
Android: Status Bar Notifications

 Follow these steps to send a Notification:

1. Get a reference to the Notification Manager


NotificationManager nm=(NotificationManager)
getSystemService(Context.NOTIFICATION_SERVICE)

2. Build the Notification message


public Notification(int icon, CharSequence tickerText, long when)
public void setLatestEvent(Context context, CharSequence contentTitle,
CharSequence contentText, PendingIntent intent)

3. Send the notification to the Notification Manager


public void notify(int id, Notification notification)

56
Android: Status Bar Notifications

Build the notification object

// Specificy icon, ticket message and time


Notification notification = new Notification([Link], "This is a very basic
Notification to catch your attention!", [Link]());

Define what will happen in case the user selects the notification

// Build an explicit intent to NotificationActivity


Intent intent = new Intent(this, [Link]);
PendingIntent pIntent = [Link](this, 0, intent,
PendingIntent.FLAG_CANCEL_CURRENT);

57
Android: Status Bar Notifications

Add (optional) flags for notification handling

// Specificy that notification will disappear when handled


[Link] |= Notification.FLAG_AUTO_CANCEL;

Send the notification to the Notification Manager

// Set short and long message to be displayed on the notification window


// Set the PendingIntent
[Link](this, "Notification", "Click to launch NotificationActivity",
pIntent);
[Link](SIMPLE_NOTIFICATION_ID, notification);

58
Android: Status Bar Notifications

Add a sound to the notification

// Use a default sound


[Link] |= Notification.DEFAULT_SOUND;

Pass an URI to the sound field to set a different sound

[Link] = [Link]([Link]

Use FLAG_INSISTENT to play the sound till notification is handled

[Link] |= Notification.FLAG_INSISTENT;

59
Android: Status Bar Notifications

Add flashing lights to the notification

// Use a default LED


[Link] |= Notification.DEFAULT_LIGHTS;

Define color and pattern of the flashing lights

[Link] = 0xff00ff00;
[Link] = 300;
notification. ledOffMS = 1000;
[Link] |= Notification.FLAG_SHOW_LIGHTS;

60
Android: Status Bar Notifications

Add vibrations to the notification

// Use a default vibration


[Link] |= Notification.DEFAULT_VIBRATE;

Define the vibration pattern

// Set two vibrations, one starting at time 0 and with duration equal to 100ms
long[] vibrate={0,100,200,300};
[Link] = vibrate;

61
Android: Status Bar Notifications

Some flags that can be used (see the documentation)

 FLAG_NO_CLEAR: Notification is not canceled


 FLAG_ONGOING_EVENT: Notify ongoing events (e.g. a call)
 FLAG_AUTO_CANCEL: Notification disappears as handled
 FLAG_INSISTENT: Reproduce sound till notification is handled
 FLAG_FOREGROUND_SERVICE: Notification from an active service

… Also PendingIntents can have flags

 FLAG_CANCEL_CURRENT: PendingIntents are ovewritten


 FLAG_UPDATE_CURRENT: PendingIntents are updated (extra field)

62
public class MainActivity extends Activity {
Button b;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
b=(Button)findViewById([Link]);
[Link](new [Link]() {
// @Override
public void onClick(View view) {
if([Link].SDK_INT>=Build.VERSION_CODES.O)
{
NotificationChannel nc=new
NotificationChannel("aa","aa",NotificationManager.IMPORTANCE_DEFAULT);
NotificationManager mm=getSystemService([Link]);
[Link](nc);
}
[Link] n=new
[Link]([Link],"aa")
.setSmallIcon([Link].ic_baseline_flare_24)
.setContentTitle("Hello1")
.setContentText("Hello")
.setPriority(NotificationCompat.PRIORITY_DEFAULT);
NotificationManagerCompat nm=[Link]([Link]);
[Link](222,[Link]());
}
});
}
}
Android: Toast Notifications

A Toast Notification is a message that pops up on the surface of the


window, and automatically fades out.

 Typically created by the foreground


activity.

 Display a message text and then fades


out

 Does not accept events! (use Status


Bar Notifications instead)

64
Android: Toast Notifications

A Toast Notification is a message that pops up on the surface of the


window, and automatically fades out.

Context context=getApplicationContext();

// Define text and duration of the notification


CharSequence text=“This is a Toast Notification!”;
int duration=Toast.LENGTH_SHORT;

Toast toast=[Link](context, text, duration);

// Send the notification to the screen


[Link]();

65
A dialog is a small window, that
prompts the user to make a decision
or enter additional information.

 A dialog does not fill the screen, and


is normally used for model events
that require users to take an action
before they can proceed.
Dialog: outline

Used to interact with the user


Little messages, easy answers
Different kinds:
 AlertDialog
 ProgressDialog
 DatePickerDialog
 TimePickerDialog
Alert Dialog

public class MainActivity extends AppCompatActivity {


Button b1;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
b1=findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View view) {
[Link] builder = new [Link]([Link]);
[Link]("Sample Alert");
[Link]("One Action Button Alert");
[Link]("OK", new [Link]() {
public void onClick(DialogInterface dialog,
int which) {
[Link]([Link], "Yes", Toast.LENGTH_SHORT).show();
}
});
[Link]();
}
});
}
}
public class MainActivity extends AppCompatActivity {
Button button;

Progress
ProgressDialog progressDialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main); Dialog
button = (Button) findViewById([Link]);
[Link](new [Link]() {
@Override
public void onClick(View v) {
progressDialog = new ProgressDialog([Link]);
[Link](100);
[Link]("Its loading....");
[Link]("ProgressDialog bar example");
[Link](ProgressDialog.STYLE_HORIZONTAL);
[Link]();
new Thread(new Runnable() {
@Override
public void run() {
try {
while ([Link]() <= [Link]()) {
[Link](200);
[Link]([Link]());
if ([Link]() == [Link]()) {
[Link]();
}
}
} catch (Exception e) {
[Link]();
}
}
}).start();
}

Handler handle = new Handler() {


@Override
public void handleMessage(Message msg) {
[Link](msg);
[Link](1);
}
};
});
}
}
DatePickerDialog
public class MainActivity extends AppCompatActivity implements [Link] {
Button b;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
b=(Button)findViewById([Link]);
final Calendar c = [Link]();
int year = [Link]([Link]);
int month = [Link]([Link]);
int day = [Link](Calendar.DAY_OF_MONTH);
final DatePickerDialog dialog = new DatePickerDialog(this, new [Link]()
{
@Override
public void onDateSet(DatePicker datePicker, int i, int i1, int i2) {

}
}, year, month, day);
[Link](new [Link]() {
@Override
public void onClick(View view) {
[Link]();
}
});

[Link]().setMaxDate([Link]());

@Override
public void onDateSet(DatePicker datePicker, int i, int i1, int i2) {

You might also like