Вопрос

I have a program that scans QR code and submits its value to a web page. And I'm using webkit to view it. So I got mainactivity.java to scan the qr code and webactivity.java to show it through webkit. I succesfully implemented slidingmenu library to webactivity class. ( Menu should be visible after user scans qr code so this is working right. ) But I only got a blank page as a sliding menu. I want to add listview to this page but I'm kinda new to android programming and most of the tutorials are so complicated. This is how I implemented the slidingmenu

setBehindContentView(R.layout.activity_menu);
getSlidingMenu().setBehindOffset(200);
getSlidingMenu().setShadowWidth(150);
getSlidingMenu().setFadeDegree(0.45f);

This obviously shows only blank page. How do I add listview and use fragments to navigate?

Thanks.

Это было полезно?

Решение

I couldn't figured out how to do this but I did some trick to achieve something like this. I created textviews on that blank page and put invisible buttons on them. I divided that textviews with a horzontal line. That buttons are launching an activity but not a fragment. There was an animation when I start an activity. Add no animation flag to your intent when starting to get rid of that animation. Now It looks just like how would a fragment does but they are actually starting activities. I hope I can help someone.

This is the final result.

http://i.imgur.com/TGVqBZu.png?1

Другие советы

jfeinstein10's provide MenuFragment.java class in which you can set your sliding menu drawer properties or layout.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top