0

我试着在我的活动中烤面包。我的活动首先使用 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;

但是它应该烤的时间,我没有看到烤面包。有什么问题?谢谢

4

1 回答 1

0

不要使用 getApplicationContext:试试

Toast.makeText(youractivity.this,"SMS Sent",Toast.LENGTH_SHORT).show();

也试试

Toast.makeText(context,"SMS Sent",Toast.LENGTH_SHORT).show();
于 2013-03-30T09:57:56.713 回答