janheinrichmerker/material-intro

Slider cannot open screens

ahmadraza330 opened this issue · 2 comments

20201231_112417_768x432.1.mp4

I am unable to open next screen in slider please help me.

This is my mainActivity.java file

`package com.example.budget.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.example.budget.R;
import com.heinrichreimersoftware.materialintro.app.IntroActivity;
import com.heinrichreimersoftware.materialintro.slide.FragmentSlide;

public class MainActivity extends IntroActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       // setContentView(R.layout.activity_main);
        setButtonBackVisible(false);
        setButtonNextVisible(false);

        addSlide(new FragmentSlide.Builder()
                .background(android.R.color.white)
                .fragment(R.layout.intro_1)
                .build());
        addSlide(new FragmentSlide.Builder()
                .background(android.R.color.white)
                .fragment(R.layout.intro_2)
                .build());
        addSlide(new FragmentSlide.Builder()
                .background(android.R.color.white)
                .fragment(R.layout.intro_3)
                .build());
        addSlide(new FragmentSlide.Builder()
                .background(android.R.color.white)
                .fragment(R.layout.intro_4)
                .build());
        addSlide(new FragmentSlide.Builder()
                .background(android.R.color.white)
                .fragment(R.layout.intro_register)
                .canGoBackward(false)
                .build());
    }

    public void btnRegister(View view) {
        startActivity(new Intent(this, RegisterActivity.class));
    }
    public void btnLogin(View view) {
        startActivity(new Intent(this, LoginActivity.class));
    }
}`

This is Register.java Activity

`package com.example.budget.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

import com.example.budget.R;

public class RegisterActivity extends AppCompatActivity {

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

}`

This is Manifest.xml
`

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/Theme.Intro">
    <activity android:name=".activity.RegisterActivity"></activity>
    <activity android:name=".activity.LoginActivity" />
    <activity android:name=".activity.MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

`

Have you been able to start RegisterActivity and LoginActivity from a blank/test Activity? And have you been able to start a blank/test Activity from the intro?
As you're using custom fragments rather than the included slides, could you include the fragment layout XML?