From: Damyan Ivanov Date: Sat, 28 Nov 2020 07:17:34 +0000 (+0200) Subject: assign click handler at runtime X-Git-Tag: v0.16.0~27 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=212517cf2f1e8f04830ea1a635a10b2a6755c999;p=mobile-ledger.git assign click handler at runtime doing it in the XML is deprecated --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java index c66f43c4..eb74e11f 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java @@ -237,6 +237,8 @@ public class MainActivity extends ProfileThemedActivity { findViewById(R.id.nav_new_profile_button).setOnClickListener( v -> startEditProfileActivity(null)); + findViewById(R.id.transaction_list_cancel_download).setOnClickListener(this::onStopTransactionRefreshClick); + RecyclerView root = findViewById(R.id.nav_profile_list); if (root == null) throw new RuntimeException("Can't get hold on the transaction value view"); diff --git a/app/src/main/res/layout/main_app_layout.xml b/app/src/main/res/layout/main_app_layout.xml index c8a71024..a33fc7b3 100644 --- a/app/src/main/res/layout/main_app_layout.xml +++ b/app/src/main/res/layout/main_app_layout.xml @@ -101,7 +101,7 @@ android:background="@drawable/ic_clear_accent_24dp" android:clickable="true" android:focusable="true" - android:onClick="onStopTransactionRefreshClick" /> + />