Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8666029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:37:42+00:00 2026-06-12T17:37:42+00:00

ViewPagerFragment.java package nsixty.crew.app; import java.util.List; import java.util.Vector; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import

  • 0

ViewPagerFragment.java

package nsixty.crew.app;

import java.util.List;
import java.util.Vector;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.ViewPager;

import com.viewpagerindicator.TitlePageIndicator;
import com.viewpagerindicator.TitleProvider;

public class ViewPagerFragment extends FragmentActivity {

    private CustomFragmentAdapter mPagerAdapter;

    ViewPager pager;
    TitlePageIndicator titleIndicator;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.setContentView(R.layout.lcmeter);

        this.initialisePaging();

    }

    private void initialisePaging() {

        List<Fragment> fragments = new Vector<Fragment>();

        fragments
                .add(Fragment.instantiate(this, LoginActivity.class.getName()));
        fragments.add(Fragment.instantiate(this, main.class.getName()));
        this.mPagerAdapter = new CustomFragmentAdapter(
                super.getSupportFragmentManager(), fragments);
        pager = (ViewPager) findViewById(R.id.viewpager);
        pager.setAdapter(this.mPagerAdapter);
        titleIndicator = (TitlePageIndicator) findViewById(R.id.titles);
        titleIndicator.setViewPager(pager);

    }

    public static class CustomFragmentAdapter extends FragmentPagerAdapter
            implements TitleProvider {
        public static final int POSITION_PAGE_1 = 0;
        public static final int POSITION_PAGE_2 = 1;
        public static final int POSITION_PAGE_3 = 2;
        private List<Fragment> fragments;
        private static final String[] TITLES = new String[] { "LOGIN", "HOME" };

        public static final int NUM_TITLES = TITLES.length;

        @Override
        public String getTitle(int position) {
            return TITLES[position];
        }

        public CustomFragmentAdapter(FragmentManager fm,
                List<Fragment> fragments) {
            super(fm);
            this.fragments = fragments;
        }

        @Override
        public int getCount() {
            // return this.fragments.size();
            return NUM_TITLES;
        }

        @Override
        public Fragment getItem(int position) {

            try {
                LoginActivity.class.newInstance();
            } catch (InstantiationException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            return this.fragments.get(position);

        }

    }

}

lcmeter.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >


    <com.viewpagerindicator.TitlePageIndicator
        android:id="@+android:id/titles"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

    <android.support.v4.view.ViewPager
        android:id="@+android:id/viewpager"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1" />

</LinearLayout>

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="nsixty.crew.app"
    android:versionCode="1"
    android:versionName="1.0" >

    <support-screens
        android:largeScreens="true"
        android:normalScreens="true"
        android:smallScreens="false" />

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <application
        android:icon="@drawable/icon87"
        android:label="@string/app_name" >
        <activity
            android:name="ViewPagerFragment"
            android:theme="@android:style/Theme.Black.NoTitleBar" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".main" >
            <intent-filter>
                <action android:name="nsixty.crew.app.main" />

                <category
                    android:name="android.intent.category.DEFAULT"
                    android:screenOrientation="portrait" />
            </intent-filter>
        </activity>
        <activity
            android:name=".play"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
            <intent-filter>
                <action android:name="nsixty.crew.app.play" />

                <category
                    android:name="android.intent.category.DEFAULT"
                    android:screenOrientation="landscape" />
            </intent-filter>
        </activity>
        <activity
            android:name=".secondView"
            android:label="@string/app_name"
            android:screenOrientation="landscape" >
            <intent-filter>
                <action android:name="nsixty.crew.app.SECONDVIEW" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name=".recorder"
            android:configChanges="orientation"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
            <intent-filter>
                <action android:name="nsixty.crew.app.RECORD" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name=".send"
            android:label="@string/app_name" >

            <!-- android:theme="@android:style/Theme.Dialog" -->
            <intent-filter>
                <action android:name="nsixty.crew.app.SHARE" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name=".gallery"
            android:theme="@android:style/Theme.Dialog" >
            <intent-filter>
                <action android:name="nsixty.crew.app.gallery" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name=".RegisterActivity"
            android:theme="@android:style/Theme.Dialog" >
        </activity>
        <activity
            android:name=".media"
            android:theme="@android:style/Theme.Dialog" >
            <intent-filter>
                <action android:name="nsixty.crew.app.media" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity android:name=".LoginActivity" >
        </activity>
        <activity android:name="CustomTitleBar" >
        </activity>
    </application>

    <uses-sdk android:minSdkVersion="8" />

    <uses-permission android:name="android.permission.WRITE_SETTINGS" >
    </uses-permission>
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />
    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />

    <uses-feature android:name="android.hardware.camera" />

</manifest>

ScreenShot1
LoginActivity activity

ScreenShot2
Sliding to main activity

Please help me with these tiny problem i just can’t figure out where the problem is coming from, i have been working for these for hours. i think the problem will be coming from the Xml layout thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:37:43+00:00Added an answer on June 12, 2026 at 5:37 pm

    I used this library View pager extensions among them i used swipey tab view indicator instead of Title page indicator and it worked perfectly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

ViewPagerFragment.java package nsixty.crew.app; import java.util.List; import java.util.Vector; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentActivity; import
There are information that it is impossible to use ViewPager within a Fragment in
I have a ViewPager and it is using a FragmentAdapter in order to display

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.