Reputation: 193
I am using the ViewPager from the Android Support package (android.support.v4.view.ViewPager). My ViewPager layout contents contains TextViews in a LinearLayout on each page.
I would like to be able to use a ContextMenu for each TextView. I have tried the code below where I registerForContextMenu with the ViewPager view, but the onCreateContextMenu method is never called.
ViewPager viewPager = (ViewPager) findViewById(R.id.mypager);
viewPager.setAdapter(viewPagerAdapter);
registerForContextMenu(viewPager);
Is it possible to use registerForContextMenu in conjunction with the ViewPager type?
Many thanks for your help.
Upvotes: 4
Views: 1923