Hi Bartek,
Of course there are many, many different scenarios, and neither I nor
you can test them all, it was just that for me the two fixes fixed two
problems.
About buttons:
I use such code to add a button to form:
public Form resultScreen;
private final Command CMD_LOGIN = new Command("Login", Command.ITEM,
1);
resultScreen = new Form("Join game");
StringItem item = new StringItem("", "Login", Item.BUTTON);
item.setDefaultCommand(CMD_LOGIN);
item.setItemCommandListener(this);
resultScreen.append(item);
Now the button "Login" will appear as simple text, although it will be
click-able. The code I supplied fixes this and it now appears as real
Android button and everything is OK. I use Android-4 SDK (for maximum
resulting binary compatibility) for compilation, but as far as I
remember the earlier SDKs has the problem too.
Regarding the canvas height:
The code would be too large to supply.
I just use standard canvas like this:
class zCanvas extends Canvas {
int bwidth, bheight; // dimensions of current screen
public void init () {
setFullScreenMode(true);
bwidth=getWidth(); bheight=getHeight();
}
protected void paint(Graphics g) {
g.setColor(245,225,200);
g.fillRect(0, 0, this.bwidth , this.bheight );
}
}
public class g_z extends MIDlet implements CommandListener Runnable
{
zCanvas canvas;
g_z()
{
canvas = new zCanvas ();
canvas.init();
canvas.repaint();
}
}
That code is incomplete of course, but just as an example.
Now upon every repaint it will cut of the bottom part of the screen -
something like it would draw as if in non-fullscreen mode, and yet the
getHeight would return the right size. By commenting out that line
everything is OK.
Valters.
On 27 Marts, 12:02, Bartek Teodorczyk <
bar...@gmail.com> wrote: