SlidingListActivity - need android.R.id.list (possible fix included)
In order to prevent the following error I made the following modification to SlidingActivityHelper which seems to work. Not sure if there are better ways to achieve the same result but it solves the problem:
public void onCreate(Bundle savedInstanceState) {
// unregister the current content view
mActivity.getWindow().getDecorView().findViewById(android.R.id.content)
.setId(View.NO_ID);
// register a new content view
mContentView = new RelativeLayout(mActivity);
mContentView.setId(android.R.id.content);
if (mActivity instanceof SlidingListActivity) {
ListView lv = new ListView(mActivity);
lv.setId(android.R.id.list);
mContentView.addView(lv);
}
// set up the SlidingMenu
mSlidingMenu = (SlidingMenu) LayoutInflater.from(mActivity).inflate(
R.layout.slidingmenumain, null);
mSlidingMenu.setViewAbove(mContentView);
mSlidingMenu.setBackgroundDrawable(mActivity.getWindow().getDecorView()
.getBackground());
mActivity.getWindow().setContentView(mSlidingMenu);
}
I just pushed the change in SlidingListActivity instead of SlidingActivityHelper
That doesn't work, as the error is thrown at line 19 of SlidingListActivity. It does work where I had it in SlidingActivityHelper.
Just put your fix in. Thanks for that :)
Pleasure. Really great project, made my life so much easier. On Jul 17, 2012 7:19 PM, "Jeremy Feinstein" < [email protected]> wrote:
Just put your fix in. Thanks for that :)
Reply to this email directly or view it on GitHub: https://github.com/jfeinstein10/SlidingMenu/issues/13#issuecomment-7044350
Thanks! It's all for you guys and the community as a whole