Comments (9)
This library is Fragment based and it needed the Activity to use this.
The problem is if you use the slider view into CollapsingToolbarLayout, so the result from the getContext() this library is ContextThemeWrapper instead AppCompatActivity.
You can solve the problem by obtaining the parent AppCompatActivity from that ContextThemeWrapper.
Open ss/com/bannerslider/views/BannerSlider.java file on line 121.
And change it from:
if (getContext() instanceof AppCompatActivity) {
hostActivity = (AppCompatActivity) getContext();
} else {
throw new RuntimeException("Host activity must extend AppCompatActivity");
}
to
if (getContext() instanceof AppCompatActivity) {
hostActivity = (AppCompatActivity) getContext();
} else if(getContext() instanceof android.view.ContextThemeWrapper){
hostActivity = (AppCompatActivity) ((ContextWrapper) getContext()).getBaseContext(); // this is to get the AppCompatActivity from the ContextThemeWrapper
} else {
throw new RuntimeException("Host activity must extend AppCompatActivity");
}
After that you can use the slider into CollapsingToolbarLayout view.
from banner-slider.
Your activity that banner slider is on it, must extend AppCompatActivity
from banner-slider.
I have extended activity with AppCompatActivity still problem is not resolved
from banner-slider.
Can you please upload the full code?
I am working on a Design like that
from banner-slider.
این مشکل منم هست . میشه راهنمایی کنین که چطور میتونم حلش کنم ؟
from banner-slider.
@andisusilo tnx for your answer but could u tell me how change a jar file without open it ?
or how make it writable in android studio because files are read only .
from banner-slider.
@ali-amani add this library as source, merge with your source code (download and merge with your source code). Don't adding in gradle.
from banner-slider.
I have the same problem there is no better solution.
from banner-slider.
when I using toolbar layout, interval was not working
any solution ?
from banner-slider.
Related Issues (20)
- Error inflating class ss.com.bannerslider.Slider
- 'int ss.com.bannerslider.adapters.PositionController.getNextSlide(int)' on a null object reference HOT 4
- Version 2.0.0 setOnSlideClickListener() not working? HOT 1
- Slider is not working with CollapsingToolbarLayout HOT 2
- Why selected drawable not circle but like diamond HOT 1
- Very silly library
- How to make slide zoomable?
- Problem with proguard HOT 1
- if interval expierd and banner not reciveiver from server crash the application
- images are messed
- ArrayIndexOutOfBoundsException after update items HOT 2
- slider image not changing after interval & indicators are also missing
- Slider does not auto slide inside CardView
- Migrate publishing to a new Repository
- How to Add OnClick
- How to Go 10th slide without Side Animation ( AnimateLayoutChanges ="false" not working!) HOT 1
- میشه فایل های صدا و ویدیو هم به جز عکس اضافه کرد یا نه؟؟ HOT 1
- how to video and voice add in slider ??
- Slider onClick HOT 4
- auto change image
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from banner-slider.