我試圖在我的活動中烤麪包。我的活動首先與GoogleMap的膨脹在爲什麼吐司在谷歌地圖中不起作用
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail_map_view);
}
然後,我設置了土司在onResume()
public void onResume() {
super.onResume();
//---create the BroadcastReceiver when the SMS is sent---
smsSentReceiver = new BroadcastReceiver(){
@Override
public void onReceive(Context arg0, Intent arg1) {
switch (getResultCode())
{
case Activity.RESULT_OK:
Toast.makeText(getBaseContext(), "SMS sent",
Toast.LENGTH_SHORT).show();
break;
但它應該是敬酒的時候,我沒有看到敬酒。 什麼可能是錯的? 感謝
嘗試ActivityName.this代替getBaseContext() – Raghunandan