Note that there are some explanatory texts on larger screens.

plurals
  1. POSlidingMenu ListFragment menu destroyed after OnItemClickListener fires
    primarykey
    data
    text
    <p>I'd like to start off by saying this is my first <em>largish</em> Android app...</p> <p>I'm using the third-party library <a href="https://github.com/jfeinstein10/SlidingMenu" rel="nofollow noreferrer">SlidingMenu</a> and everything is working great except for one thing: when the user taps a list item in the "basement" menu, that ListFragment is destroyed. I set logs in all of the construction/deconstruction methods of the ListFragment to log the activity. Here's an image of the log, edited to show when the touch event occurred.</p> <p><img src="https://i.stack.imgur.com/aTnJn.png" alt="enter image description here"></p> <p>My ListFragment class is setup like so:</p> <pre class="lang-java prettyprint-override"><code>public class BasementFragment extends ListFragment implements PictureCallback { BasementAdapter mAdapter; RelativeLayout mHeader; ArrayList&lt;String&gt; titles; ImageView mImageButton; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { Log.d("BASEMENTFRAGMENT", "onCreateView"); ListView view = (ListView) inflater.inflate(R.layout.basement, null); mHeader = (RelativeLayout) inflater.inflate(R.layout.basement_header, null); view.addHeaderView(mHeader); mImageButton = (ImageView) mHeader.findViewById(R.id.image_button); mImageButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { pickImage(); } }); ParseFile imageFile = (ParseFile) ParseUser.getCurrentUser().get(NJUser.IMAGE_KEY); if (imageFile != null) { imageFile.getDataInBackground(new GetDataCallback() { @Override public void done(byte[] data, ParseException e) { InputStream is = new ByteArrayInputStream(data); Bitmap bmp = BitmapFactory.decodeStream(is); mImageButton.setImageBitmap(bmp); } }); } return view; } // touch logic and other stuff... } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload