replace onClick XML declaration with a runtime hook
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Mon, 21 Jan 2019 19:38:59 +0000 (19:38 +0000)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Mon, 21 Jan 2019 19:38:59 +0000 (19:38 +0000)
fails in API 22

app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java
app/src/main/res/layout/activity_main.xml

index 1afc155..f8bb6ce 100644 (file)
@@ -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() {
index 7f01a1b..6ddb67e 100644 (file)
@@ -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"