私がやっていることは、onResumeにgetIntent();
を取得することです。すべての事は唯一onResumeがスレッドタイマーで動作しない
ここMainActivityで起こっている私のコードであるが、その動作していないものは何も
@Override
protected void onResume() {
Thread timer = new Thread() {
public void run() {
try {
sleep(3000);
} catch (InterruptedException e) {
e.printStackTrace();
} finally {
Intent intent = getIntent();
String restaurant_name = intent.getStringExtra("restaurant_name");
Toast.makeText(MainActivity.this, restaurant_name, Toast.LENGTH_LONG).show();
if (restaurant_name != null) {
if (restaurant_name.equals("Romys")) {
mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(26.89209, 75.82759), 15.0f));
mMap.addMarker(new MarkerOptions()
.position(new LatLng(26.89553, 75.82842))
.title("ROMYS"))
.showInfoWindow();
}
} else {
Toast.makeText(MainActivity.this, "It was not", Toast.LENGTH_LONG).show();
}
}
}
};
timer.start();
super.onResume();
}
を作業していない私はonResume
onNewInent
を試みたが、アプリがクラッシュします。
あなたがlogcatからなっているか、エラー投稿することができますか? –
@ noidea3p5 sir私も何かエラーが発生していません..それは乾杯を表示する夕方でもありません – user3692487
実際に何をしているのですか私はListViewクラスからインテントを送信しています..そして、私はAlertBoxのすべてのショーですべての日付を表示していますMainActivityはホルダーのアラートボックスをクリックした後に消えて再びmainActivityが開始するので、その目的を取得してmap.animateCameraを実行したい – user3692487