janheinrichmerker / material-intro

A simple material design app intro with cool animations and a fluent API.
https://jitpack.io/#com.heinrichreimer/material-intro
MIT License
1.74k stars 307 forks source link

Slider cannot open screens #305

Open ahmadraza330 opened 3 years ago

ahmadraza330 commented 3 years ago

https://user-images.githubusercontent.com/74761556/103398385-62cb5a80-4af1-11eb-9cd3-c714b080bf74.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 `<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.budget">

<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>

`

janheinrichmerker commented 3 years ago

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?

ahmadraza330 commented 3 years ago

Yes I include empty Activity. On Mon, Jan 4, 2021, 6:27 AM Jan Heinrich Reimer notifications@github.com wrote:

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?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/heinrichreimer/material-intro/issues/305#issuecomment-753713195, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR2MKVAYC7RORTHYR3NOHW3SYEKRVANCNFSM4VPEBUGQ .