The method setTabListener(ActionBar.TabListener) in the type ActionBar.Tab is not applicable for the arguments (new Runnable(){})
Async onPostExecute 错误error
添加 setTabListener(new ActionBar.TabListener() 就能解决以上的error
- // For each of the sections in the app, add a tab to the action bar.
- for (int i = 0; i < mSectionsPagerAdapter.getCount(); i++) {
- // Create a tab with text corresponding to the page title defined by
- // the adapter. Also specify this Activity object, which implements
- // the TabListener interface, as the callback (listener) for when
- // this tab is selected.
- actionBar.addTab(actionBar.newTab()
- .setText(mSectionsPagerAdapter.getPageTitle(i))
- .setTabListener(new ActionBar.TabListener() {
-
- @Override
- public void onTabSelected(ActionBar.Tab tab,
- FragmentTransaction fragmentTransaction) {
- // When the given tab is selected, switch to the corresponding page in
- // the ViewPager.
- mViewPager.setCurrentItem(tab.getPosition());
- }
- @Override
- public void onTabUnselected(ActionBar.Tab tab,
- FragmentTransaction fragmentTransaction) {
- }
- @Override
- public void onTabReselected(ActionBar.Tab tab,
- FragmentTransaction fragmentTransaction) {
- }
- }));
- }
复制代码 |
|