PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → Passage de paramètre à une procédure Java
Passage de paramètre à une procédure Java
Débuté par Philippe SB, 11 oct. 2017 06:23 - 2 réponses
Membre enregistré
2 571 messages
Popularité : +222 (260 votes)
Posté le 11 octobre 2017 - 06:23
Bonjour,

Impossible de passer un paramètre chaine à une procédure java. J'ai en permanence l'erreur:
method CustomMap in class GWDCPCOL_GoogleMap cannot be applied to given types;
GWDCPCOL_GoogleMap.CustomMap();
                  ^
  required: String
  found: no arguments
  reason: actual and formal argument lists differ in length
1 error
 FAILED


Le code:
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.MapView;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import com.google.android.gms.maps.model.Marker;
import android.widget.Toast;

public static void CustomMap(final String marqueurs)
{
MapView mapView = (MapView) getView("CARTE_Accueil");
mapView.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(GoogleMap googleMap) {
String mesMarqueurs[] = marqueurs.split("||");
String Valeurs[];

for (int i = 0; i < mesMarqueurs.length; i++){
Valeurs = mesMarqueurs[i].toString().split("&&");
googleMap.addMarker(new MarkerOptions().position(new LatLng(Double.parseDouble(Valeurs[0].toString()),Double.parseDouble(Valeurs[1].toString()))).title(Valeurs[2].toString()).snippet("Nombre de bloc : 250"));

}
// //centre la google map sur Paris (avec animation de zoom)
// googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(PARIS, 15));
// googleMap.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);
//
googleMap.setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() {
@Override
public void onInfoWindowClick(Marker marker) {
Toast.makeText(getContexteApplication(),marker.getTitle(),Toast.LENGTH_LONG).show();

appelProcedureWL("FEN_Menu.snippet",marker.getTitle());
}
});
}
});
}


Si quelqu'un a une idée je suis preneur.

--
Cordialement,

Philippe SAINT-BERTIN
Géode Informatique
Membre enregistré
795 messages
Popularité : +40 (42 votes)
Posté le 12 octobre 2017 - 20:55
hello, where is the code you use to call the function?

The function needs a String parameter, and in the error it is said that you do not pass it.


Rubén
Posté le 16 octobre 2017 - 10:04
Bonjour,
On dirait que le code généré par Windev ne correspond pas à la fonction écrite dans windev.
Avez-vous vérifier le code généré dans le dossier %projet%\android\compile ?