Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is possible add five items to BottomBarHolderActivity #8

Open
kyodgorbek opened this issue Oct 6, 2018 · 0 comments
Open

It is possible add five items to BottomBarHolderActivity #8

kyodgorbek opened this issue Oct 6, 2018 · 0 comments

Comments

@kyodgorbek
Copy link

Hi thank you for your library I am using it in my android news app it is possible to increase items to 5 when I have added fifth item. It is giving this exception java.lang.RuntimeException: Unable to start activity ComponentInfo{yodgobekkomilov.edgar.com.worldnews/yodgobekkomilov.edgar.com.worldnews.MainActivity}: java.lang.RuntimeException: List of NavigationPage must contain 4 members.

below my code from MainActivity
public class MainActivity extends BottomBarHolderActivity implements AllJazeeraFragment.OnFragmentInteractionListener, BBCFragment.OnFragmentInteractionListener, CNNFragment.OnFragmentInteractionListener, CBCNewsFragment.OnFragmentInteractionListener {

//    private ApiService apiService;
public static final String url_key = "urlKey";
public ArrayList<Article> articleList = new ArrayList<>();


@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    // getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);

    Article article = new Article(Parcel.obtain());
    article.setUrl(article.getUrl());
    Intent i = new Intent(this, DetailActivity.class);
    i.putExtra("urlKey", article);

// // using the (String name, Parcelable value) overload!
// startActivity(i);

    NavigationPage page1 = new NavigationPage("AllJazeera", ContextCompat.getDrawable(this, R.drawable.alljazeera), AllJazeeraFragment.newInstance());
    NavigationPage page2 = new NavigationPage("BBC", ContextCompat.getDrawable(this, R.drawable.bbc_icon), CNNFragment.newInstance());
    NavigationPage page3 = new NavigationPage("CNN", ContextCompat.getDrawable(this, R.drawable.cnn_icon), AllJazeeraFragment.newInstance());
    NavigationPage page4 = new NavigationPage("CBC", ContextCompat.getDrawable(this, R.drawable.cbc_icon), CBCNewsFragment.newInstance());
    NavigationPage page5 = new NavigationPage("Menu", ContextCompat.getDrawable(this, R.drawable.icon_menu), Menu.newInstance());
    List<NavigationPage> navigationPages = new ArrayList<>();
    navigationPages.add(page1);
    navigationPages.add(page2);
    navigationPages.add(page3);
    navigationPages.add(page4);
    navigationPages.add(page5);
    super.setupBottomBarHolderActivity(navigationPages);
}


public void onClicked() {
    Toast.makeText(this, "Clicked!", Toast.LENGTH_SHORT).show();
}

}
and help and suggestion will be appreacited

@kyodgorbek kyodgorbek changed the title It is possible one more items It is possible add five items Oct 6, 2018
@kyodgorbek kyodgorbek changed the title It is possible add five items It is possible add five items to BottomBarHolderActivity Oct 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant