OnResume (), not called a second time, the action is triggered

During normal development, I noticed that a certain action stopped responding a second time when it was triggered.

i.e. menu->(intent)->activity->(back button)->menu->(intent)

There is nothing relevant in logcat.

I don’t even know where to start debugging this, nor any code to show this, here are the fragments onClickand onResume:

 if (!dictionary.getClassName().equals("")) {

            this.setOnClickListener(new OnClickListener() {
                public void onClick(View v) {

                    Intent i;

                    i = new Intent(mContext, NVGlobeNavigatorVC.class);
                    i.putExtra("PAGE_TITLE", title);
                    i.putExtra("TITLE", _dictionary._title);

                    mContext.startActivity(i);

            });
        } else {
            findViewById(R.id.greaterthan).setVisibility(View.GONE);
        }

and at the start of the Activity:

@Override
protected void onResume() {

    super.onResume();

    ...

Nothing unusual in the manifest:

<activity
    android:name=".NVViews.NVGlobeNavigatorVC"
    android:theme="@style/WindowTitleBackground"
    android:label="GlobeNavigator"/>

For clarity, I set breakpoints on mContext.startActivity(i)and super.onResume(). I click the view with onClickListener, and both breakpoints fall as expected. Then I press the back button, which returns me to the menu. onPause()called as expected.

, , startActivity , onResume() . , - . , dalvik.system.NativeStart(), , .

, , Intellij IDEA , .

Target API - 8. 2.3 4.0.4.

? .

[EDIT]

onPause . onResume() - :

@Override
protected void onPause() {

   super.onPause();

   SCPrefs.setGlobeViewViewPoint(globeView.getViewPoint());
   SCPrefs.setGlobeViewZoom(globeView.getZoom());
   SCPrefs.setGlobeViewScale(globeView.getScale());

    }
+5
2

, .

, . , , , .

, , onCreate() onResume().

, .

+4

:

i = new Intent(mContext, NVGlobeNavigatorVC.class);

. NVGlobeNavigatorVC.class.

, , "iTheFirst". , "on pause". , , . , , , "iTheSecond". , iTheFirst, .

, , . onClick , , , , , .

, :

Intent savedCueCardActivity = null;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState, R.layout.landing);
}

public void goToNextScreen(View v) {
    if (savedCueCardActivity == null) {
        savedCueCardActivity = new Intent().setClass(this, CueCardActivity.class);
        startActivity(savedCueCardActivity);
        //       lastActivity.finish();
    } else {
        savedCueCardActivity.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
        startActivity(savedCueCardActivity);
    }
    overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
}
+3

All Articles