Java

Catatan

  1. Fungsi button back pada topbar bawaan android

@Override
    public boolean onSupportNavigateUp() {
        PurchaseRequisitionActivity.this.finish();
        return true;
    }

File > Project Structure > Dependencies

  1. mpandroid chart : library

com.github.PhilJay:MPAndroidChart
  1. evrencoskun : library

com.evrencoskun.library
  1. volley : library api

com.android.volley
  1. codecrafters : library

cn.org.codecrafters

Set dialogbox detail

AlertDialog.Builder builder = new AlertDialog.Builder(YourActivity.this);
                    builder.setTitle("Your Title")
                            .setView(")
                            .setPositiveButton("OK", new DialogInterface.OnClickListener() {
				
                            })
                            .setNegativeButton("CANCEL", new DialogInterface.OnClickListener() {
                                
                            });

                    AlertDialog dialog = builder.create();
                    dialog.show();

Set dialogbox with textview

final EditText input = new EditText(YourActivity.this);
                    input.setInputType(InputType.TYPE_CLASS_TEXT);

                    AlertDialog.Builder builder = new AlertDialog.Builder(ModifyPROptionsActivity.this);
                    builder.setTitle("Your Title")
                            .setView(input)
                            .setPositiveButton("OK", new DialogInterface.OnClickListener() {
                                @Override
                                public void onClick(DialogInterface dialog, int which) {
                                    rejReason = input.getText().toString();
                                }
                            })
                            .setNegativeButton("CANCEL", new DialogInterface.OnClickListener() {
                                @Override
                                public void onClick(DialogInterface dialog, int which) {
                                    dialog.cancel();
                                }
                            });

                    AlertDialog dialog = builder.create();
                    dialog.show();

Last updated