Hello I have a Problem with the MapContainer component on Android:
If I open my screen I get following error message:
"An internal application error occurred java.lang.NullPointerException:
Attempt to invoke virtual methode 'int java.io.InputStream.read(byte[]) on
a null object reference"
I use following Code
Form l_form = new Form("Google Maps");
l_form.setLayout(new BorderLayout());
final MapContainer l_map = new MapContainer();
final Label l_label = new Label("Location: ...");
try {
l_map.addMarker(EncodedImage.create("maps-pin.png"), new Coord(
41.889, -87.622), "Hi marker", "Hello", new ActionListener() {
public void actionPerformed(ActionEvent evt) {
Dialog.show("Marker Clicked!", "You clicked the marker",
"OK", null);
}
});
} catch (IOException e) {
e.printStackTrace();
}
l_map.addMapListener(new MapListener() {
public void mapPositionUpdated(Component source, int zoom, Coord
center) {
l_label.setText("0 lon: " + l_map.getCoordAtPosition(0, 0).
getLongitude()+ " w lon " + l_map.getCoordAtPosition(Display.getInstance().
getDisplayWidth(), 0).getLongitude());
}
});
l_form.addComponent(BorderLayout.SOUTH, l_label);
l_form.addComponent(BorderLayout.CENTER, l_map);
addSidebar(l_form);
g_current = l_form;
l_form.show();
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/36712e95-0f62-4910-be01-8cc7129d8420%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.