0
我將評分值設爲float,但我想在infowindow中將該值顯示爲評分欄。我想從markeroptions.snippet獲取評分值,並在infowindow中的評分欄上顯示評分
我將評分值設爲float,但我想在infowindow中將該值顯示爲評分欄。我想從markeroptions.snippet獲取評分值,並在infowindow中的評分欄上顯示評分
公共查看getInfoContents(標記標記){
String snippet1 = marker.getTitle();
String var = snippet1.substring(6, 9);
try {
if (!var.equals(null)) {
ratingBar1.setRating(Float.parseFloat(String.valueOf(var)));
} else {
Toast.makeText(getBaseContext(), "no ratings", Toast.LENGTH_SHORT).show();
}
} catch (NumberFormatException e) {
System.out.print("no ratings!!!");
}
LatLng ll = marker.getPosition();
placename.setText(marker.getTitle());
tvlat.setText("Longitute" + ll.latitude);
tvlng.setText("Longitute" + ll.longitude);
snippet.setText(marker.getSnippet());
return v;
}
});
marker.title( 「等級」 +等級); –
請出示你的一些代碼的 –