im pretty new to Android Studio and I already did some research but didn't found a solution. I want to create an object (button) at runtime per Java. I already tried this:
In global:
Button btn;
In method:
Button btn = (Button) findViewById(R.id.btn);
But this isn't working. So can somebody show me, how I can create a button at runtime and also how to change the attributes.
Thank You