mapView クラスと StoreFinder クラスがあります。ジオポイント値の経度と緯度を保持する AlertDialog にあるボタンを押すことができるようにしたいと考えています。MapView に経度と緯度の値の位置を表示したい。
単純:
ALERTDIALOGの経度と緯度でボタンを押します - > MapViewの表示位置。
どうすればこれを行うことができますか?
十分な時間をありがとうございました。
コード:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.storefinder_bars);
sirius();
}
public void sirius() {
ImageButton hoursButton = (ImageButton) findViewById(R.id.hours);
ImageButton addressButton = (ImageButton) findViewById(R.id.address);
//ImageButton phoneButton = (ImageButton) findViewById(R.id.phone);
final AlertDialog.Builder siriushours = new AlertDialog.Builder(this);
hoursButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
siriushours.setTitle("Opening Hours");
siriushours.setMessage(
"\n---Monday---\n" + "CLOSED"
+ "\n\n---Tuesday---\n" + "CLOSED"
+ "\n\n---Wednesday---\n" + "22:00 - 3:00"
+ "\n\n---Thursday---\n" + "CLOSED"
+ "\n\n---Friday---\n" + "22:00 - 3:00"
+ "\n\n---Saturday---\n" + "22:00 - 3:00"
+ "\n\n---Sunday---\n" + "CLOSED");
siriushours.setPositiveButton("OK",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,
int which) {
dialog.dismiss();
}
});
siriushours.show();
}
});
//ADDRESS
final AlertDialog.Builder siriusadd = new AlertDialog.Builder(this);
addressButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
siriusadd.setTitle("Address");
siriusadd.setMessage(
"33 Belvoir Street, Leicester , LE1 6SL");
siriusadd.setPositiveButton("Show On Map",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,
int which) {
}
});
siriusadd.setNegativeButton("Route",
new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog,
int which) {
Intent intent = new Intent(android.content.Intent.ACTION_VIEW,
Uri.parse("http://maps.google.com/maps?daddr="+52.63274+","+-1.13145));
startActivity(intent);
}
});
siriusadd.show();
}
});
}
ポジティブ ボタンをここに配置したい: "siriusadd.setPositiveButton("Show On Map", ") これにより、AlertDialog から MapView の地理座標にジャンプできるようになります。そうでない場合は、バルーンのアイテム化されたレイアウトがあり、マーカーが代わりにそこにジャンプしてくれればいいのですが、ジオポイントでも構いません。
すべての支援に乾杯。