Merge branch 'main' of ssh://gitlab.fdmci.hva.nl/propedeuse-hbo-ict/onderwijs/2023-2024/out-a-se-ti/blok-4/muupooviixee66

This commit is contained in:
SebasKoedam
2024-04-18 15:10:25 +02:00

View File

@@ -0,0 +1,18 @@
package com.fitbot.fitbot;
import android.app.Activity;
import android.widget.TextView;
public class TextSetter {
public static void setCustomText(Activity activity, int textViewId, String text) {
TextView textView = (TextView) activity.findViewById(textViewId);
textView.setText(text);
}
}
// usage:
// TextSetter.setCustomText(this, R.id.testText, "Bruh");
// r.id.testText is the id of the textview in the layout file
// "Bruh" is the text to be set
// make sure you have the right layout set in MainActivity.java with the setContentView method