> For the complete documentation index, see [llms.txt](https://asamarsal.gitbook.io/notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://asamarsal.gitbook.io/notes/personal-documentation/mobile/java.md).

# Java

1. Fungsi button back pada topbar bawaan android

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

**File > Project Structure > Dependencies**

2. mpandroid chart : library

```
com.github.PhilJay:MPAndroidChart
```

3. evrencoskun : library

```
com.evrencoskun.library
```

4. volley : library api

```
com.android.volley
```

5. 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();
```
