Been trying to create customer dialog box and I copied source code from android website. I worked my way round a few things now I'm really stuck. I don't know what LoginFragment is in the code:
...
public class start extends Activity{
Button buttonx;
final Context context = this;
LayoutInflater mInflater;
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.menu);
}
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(context);
// Get the layout inflater
//LayoutInflater inflater = getActivity().getLayoutInflater();
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// Inflate and set the layout for the dialog
// Pass null as the parent view because its going in the dialog layout
builder.setView(mInflater.inflate(R.layout.login, null))
// Add action buttons
.setPositiveButton(R.string.signin, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int id) {
// sign in the user ...
}
})
.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
LoginDialogFragment.this.getDialog().cancel();
}
});
return builder.create();
}
When I //comment the line out the line out it says @Override is unnecessary which doesnt solve anything. Sorry for noob question