{"action":"closed","issue":{"url":"https://api.github.com/repos/ogaclejapan/SmartTabLayout/issues/99","labels_url":"https://api.github.com/repos/ogaclejapan/SmartTabLayout/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/ogaclejapan/SmartTabLayout/issues/99/comments","events_url":"https://api.github.com/repos/ogaclejapan/SmartTabLayout/issues/99/events","html_url":"https://github.com/ogaclejapan/SmartTabLayout/issues/99","id":119670642,"number":99,"title":"Settings tab titles with SmartTabLayout using custom adapter and extending PagerAdapter","user":{"login":"santafebound","id":8828948,"avatar_url":"https://avatars.githubusercontent.com/u/8828948?v=3","gravatar_id":"","url":"https://api.github.com/users/santafebound","html_url":"https://github.com/santafebound","followers_url":"https://api.github.com/users/santafebound/followers","following_url":"https://api.github.com/users/santafebound/following{/other_user}","gists_url":"https://api.github.com/users/santafebound/gists{/gist_id}","starred_url":"https://api.github.com/users/santafebound/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/santafebound/subscriptions","organizations_url":"https://api.github.com/users/santafebound/orgs","repos_url":"https://api.github.com/users/santafebound/repos","events_url":"https://api.github.com/users/santafebound/events{/privacy}","received_events_url":"https://api.github.com/users/santafebound/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-01T09:00:19Z","updated_at":"2015-12-02T01:23:21Z","closed_at":"2015-12-02T01:23:21Z","body":"Hi,\r\n\r\nI have a custom adapter for my ViewPager and I was wondering if there was any way to the set title of each tab? The following is my custom adapter:\r\n\r\n```Java\r\npublic class CustomPagerAdapter extends PagerAdapter {\r\n\r\n    private int[] image_resources = {\r\n            R.drawable.image1,\r\n            R.drawable.image2,\r\n            R.drawable.image3,\r\n            R.drawable.image4,\r\n            R.drawable.image5,\r\n    };\r\n\r\n    private Context ctx;\r\n    private LayoutInflater layoutInflater;\r\n    public CustomPagerAdapter(Context ctx) {\r\n        this.ctx = ctx;\r\n    }\r\n\r\n    @Override\r\n    public int getCount() {\r\n        return image_resources.length;\r\n    }\r\n\r\n    @Override\r\n    public boolean isViewFromObject(View view, Object o) {\r\n        return (view == (RelativeLayout) o);\r\n    }\r\n\r\n    @Override\r\n    public Object instantiateItem(ViewGroup container, int position) {\r\n        layoutInflater = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);\r\n        View item_view = layoutInflater.inflate(R.layout.pager_item, container, false);\r\n        ImageView imageview = (ImageView) item_view.findViewById(R.id.image_view);\r\n        imageview.setImageResource(image_resources[position]);\r\n        container.addView(item_view);\r\n        return item_view;\r\n    }\r\n\r\n    @Override\r\n    public void destroyItem(ViewGroup container, int position, Object object) {\r\n        container.removeView((RelativeLayout) object);\r\n    }\r\n}\r\n```\r\n\r\nThis is how I set up my ViewPager, and also where I initiate SmartTabLayout:\r\n\r\n```Java\r\n final ViewPager viewPager;\r\n        CustomPagerAdapter adapter;\r\n        viewPager = (ViewPager) findViewById(R.id.view_pager);\r\n        adapter = new CustomPagerAdapter(context);\r\n        viewPager.setAdapter(adapter);\r\n\r\n        SmartTabLayout viewPagerTab = (SmartTabLayout) findViewById(R.id.viewpagertab);\r\n        viewPagerTab.setViewPager(viewPager);\r\n```\r\n\r\nAs you can see in the images below it works great, but I can't set the titles in the standard way! How can I do this?\r\n\r\n![screenshot_20151201-005903](https://cloud.githubusercontent.com/assets/8828948/11496456/d2b104a0-97c6-11e5-980d-3b35749e0dd0.png)\r\n![screenshot_20151201-005858](https://cloud.githubusercontent.com/assets/8828948/11496457/d2b2da14-97c6-11e5-8f5e-1f7f1b8764f7.png)\r\n"}}