Last active
March 8, 2025 15:16
-
-
Save hangsopheak/4d17c7b4028415f0dc03193873b7e851 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Sample | |
| @Override | |
| public void onBindViewHolder(@NonNull ExpenseViewHolder holder, int position) { | |
| Expense expense = expenses.get(position); | |
| holder.title.setText(expense.getTitle()); | |
| holder.amount.setText(expense.getAmount() + " " + expense.getCurrency()); | |
| // Navigate to DetailExpenseActivity and pass only the expense ID | |
| holder.itemView.setOnClickListener(v -> { | |
| Intent intent = new Intent(holder.itemView.getContext(), DetailExpenseActivity.class); | |
| intent.putExtra("expenseId", expense.getId()); // Pass only the ID | |
| context.startActivity(intent); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment