Java
Catatan
Fungsi button back pada topbar bawaan android
@Override
public boolean onSupportNavigateUp() {
PurchaseRequisitionActivity.this.finish();
return true;
}File > Project Structure > Dependencies
mpandroid chart : library
com.github.PhilJay:MPAndroidChartevrencoskun : library
com.evrencoskun.libraryvolley : library api
com.android.volleycodecrafters : library
cn.org.codecraftersSet 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