Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //here i call startActivityForResult(
- myBtn.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- Intent i = new Intent(MainActivity.this,
- FilterMentionActivity.class);
- i.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
- startActivityForResult(i, 1);
- }
- });
- //here is the on
- @Override
- protected void onActivityResult(int requestCode, int resultCode, Intent data) {
- super.onActivityResult(requestCode, resultCode, data);
- Log.d("onActivityResult","called ******"); // this calls whenever startActivityForResult is called
- if(resultCode==RESULT_OK && requestCode==1){
- Log.d("win win","win win"); // this never fires
- }
- }
- //this is the called activity
- Intent in = getIntent();
- Bundle bdl = new Bundle();
- bdl.putString("name", mentionNameChoice);
- in.putExtras(bdl);
- setResult(RESULT_OK,in);
- finish(); // the activity finishes fine, but onActivityResult never calls :(
Add Comment
Please, Sign In to add comment