Can someone please help me on how I can add OK information dialog box in my fragment class? I have tried this but it is not working, it works in activity class but not in fragments. I must be missing something or doing is completely wrong, can someone help me out?
Edited: A method, something along the lines of;
public void rideInfor(ImageButton button, findViewById buttonID, String title, String message){
ImageButton button = (ImageButton)rootView.findViewById(R.id.buttonID);
button.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View v)
{
AlertDialog.Builder builder1 = new AlertDialog.Builder(getActivity());
builder1.setTitle(title);
builder1.setMessage(message);
// builder1.setIcon(R.drawable.ic_launcher);
builder1.setNeutralButton("Yes", new DialogInterface.OnClickListener()
{
@Override
public void onClick(DialogInterface dialog, int which)
{
dialog.cancel();
}
});
builder1.show();
}
});