Quantcast
Channel: User Mr.Goomer - Stack Overflow
Viewing all articles
Browse latest Browse all 42

Display toast after startActivityForResult

$
0
0

I am trying to display a toast message after the user gets to the main intent.

I try to accomplish that by doing this by the code below but with no success:

On the second activity(MapsActivity) I did:

    public void userLocationIsNull(){        Intent intent = new Intent(MapsActivity.this, MainActivity.class);        startActivityForResult(intent,1010);    }

And on the first activity(MainActivity) I did:

  @Override  protected void onActivityResult(int requestCode, int resultCode, Intent data) {   super.onActivityResult(requestCode, resultCode, data);            if (requestCode == 1010) {                Toast.makeText(this, "System could find your location,please try again", Toast.LENGTH_SHORT).show();            }}

The intent is working,but the Toast is'nt showing,glad to hear your thoughts,thanks.


Viewing all articles
Browse latest Browse all 42

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>