Android Question Layout in inline java

apty

Active Member
Licensed User
Longtime User
How is B4A layout file (.bal) loaded in an inline java code?
e.g. i have the following in java
B4X:
setContentView(R.layout.main);

i would like to replace that with a B4A layout
 

apty

Active Member
Licensed User
Longtime User
Thanks Erel.
Kindly see part of my code below, it becomes difficult to load the layout from B4A code because it has to be called inside the onCreate method, else the app will crash.
B4X:
public void _onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
context = this;

setUpWindow();
//I have to load the layout here, or else the app will crash
setContentView(R.layout.mainl);

}

public void setUpWindow() {

//function

}
 
Upvote 0

apty

Active Member
Licensed User
Longtime User
It is a B4A app but the functionality is implemented in Java. I need it in B4A because the interface is easily built in B4A layout.
The app is an overlay activity, it is already working in Java (Android). I was just trying to see if its possible to replace the layout/views from .xml to .bal
 
Upvote 0
Top