From 86e2084b850138f76c159d38adebe99282d174de Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Mon, 21 Jan 2019 19:38:59 +0000 Subject: [PATCH] replace onClick XML declaration with a runtime hook fails in API 22 --- .../java/net/ktnx/mobileledger/ui/activity/MainActivity.java | 2 ++ app/src/main/res/layout/activity_main.xml | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) 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 1afc155d..f8bb6ce3 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 @@ -166,6 +166,8 @@ public class MainActivity extends AppCompatActivity { }); findViewById(R.id.btn_no_profiles_add).setOnClickListener(v -> startAddProfileActivity()); + + findViewById(R.id.btn_add_transaction).setOnClickListener(this::fabNewTransactionClicked); } @Override protected void onResume() { diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 7f01a1be..6ddb67e4 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -51,7 +51,6 @@ android:layout_height="wrap_content" android:layout_gravity="bottom|end" android:layout_margin="@dimen/fab_margin" - android:onClick="fabNewTransactionClicked" app:backgroundTint="@color/colorAccent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" -- 2.39.5