Ask Your Question
0

Android onActivityResult shutdown (kinetic)

asked 2018-09-18 01:30:48 -0500

eminemm gravatar image

updated 2018-09-18 03:32:28 -0500

Hi,

How should I properly use onActivityResult in my MainActivity that extends RosActivity?

In my MainActivity, I call another activity using startactivityforresult, then in that activity I call

Intent resultIntent = new Intent(); resultIntent.putExtra(INSERTED_ORDER, orderET.getText().toString()); setResult(Activity.RESULT_OK, resultIntent); finish();

but after that the method shutdown() of RosActivity is getting called closing the application.

Without RosActivity my code works correctly and the only difference is that I added super.onActivityResult(requestCode,resultCode,data); otherwise init(NodeMainExecutor nodeMainExecutor) is not getting called after MasterChooser activity.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-09-18 03:28:12 -0500

eminemm gravatar image

updated 2018-09-18 03:28:55 -0500

I just found where the problem is. Basically when I call super.onActivityResult(requestCode,resultCode,data) inside onActivityResult(int requestCode, int resultCode, Intent data), in my RosActivity, it calls onActivityResult(requestCode,resultCode,data) of RosActivity.java where if (requestCode != MASTER_CHOOSER_REQUEST_CODE) it calls nodeMainExecutorService.forceShutdown();

In my MainActivity, inside onActivityResult I call super.onActivityResult(requestCode,resultCode,data) only when requestCode is different from the one I created resolving the problem.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-09-18 01:30:48 -0500

Seen: 133 times

Last updated: Sep 18 '18