public void onStop() {
information=Option.getText().toString();
if (!information.equals("")) {
//Toast.makeText(activity, "All unsubmitted information will be discarded", Toast.LENGTH_SHORT).show();
LayoutInflater inflater = null;
inflater = (LayoutInflater)activity.
getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflater.inflate(R.layout.layout_back_press,null);
AlertDialog.Builder builder = new AlertDialog.Builder(v.getContext());
builder.setView(v);
dialog = builder.create();
dialog.show();
TextView cancel = (TextView) v.findViewById(R.id.txt_Cancel);
cancel.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dialog.cancel();
//Toast.makeText(activity, "Feedback not sent", Toast.LENGTH_SHORT).show();
}
});
TextView send = (TextView) v.findViewById(R.id.txt_Send);
send.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dialog.cancel();
FeedbackConcernsFragment.super.onStop();
// FeedbackConcernsFragment.onStop();
//Toast.makeText(activity, "Feedback sent", Toast.LENGTH_SHORT).show();
}
});
}else {
super.onStop();
}
}
E/AndroidRuntime:致命異常:主 工藝:com.guideme,PID:23746 android.util.SuperNotCalledException:片段 FeedbackConcernsFragment {22c43a48#2的ID = 0x7f110159}沒有通過在android.app.Fragment.performStop(Fragment.java:1873) 在android.app.FragmentManagerImpl.moveToState(FragmentManager.java:941) 在android.app.FragmentManagerImpl致電 到super.onStop() .removeFragment(FragmentManager.java:1167) 在android.app.BackStackRecord.popFromBackStack(BackStackRecord.java:718) 在android.app.FragmentManagerImpl.popBackStackState(FragmentManager.java:1496) 在android.app.FragmentManagerImpl.popBackStackImmediate(FragmentManager.java:495) 在android.app.Activity.onBackPressed(Activity.java:2288) at android.support.v4.app.FragmentActivity.onBackPressed(FragmentActivity.java:179) at com.guideme.activities.MainActivity.onBackPressed(MainActivity.java: 352) at android.app.Activity.onKeyUp(Activity.java:2266) at android.view.KeyEvent.dispatch(KeyEvent.java:2724) at android.app.Activi在android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:59)上android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:541) 上的ty.dispatchKeyEvent(Activity.java:2496) 在android.support.v7.app.AppCompatDelegateImplBase $ AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:319)編碼的onStop崩潰應用
的可能的複製[android.app.SuperNotCalledException:活動並未通過調用super.onStop ()](https://stackoverflow.com/questions/9397020/android-app-supernotcalledexception-activity-did-not-call-through-to-super-onst) – Torben