sticky or pinned sectioned list view in android with dynamic dataHow do I pass data between Activities in Android application?What is the simplest and most robust way to get the user's current location on Android?Android “Only the original thread that created a view hierarchy can touch its views.”How to create a Custom Dialog box in android?How to disable or not show any headers for StickyListHeaders from emilsjolanderHow to add sticky section headers in listview?How custom Sticky headers work in Android Listviews?How to programmatically open the Permission Screen for a specific app on Android Marshmallow?Implementing Android (no 3rd party) Listview SubheadersAndroid Import library error DefaultGroovyMavenDeveloper

Usage of blank space in trade banner and text-positioning

Ambiguity in notation resolved by +

What 68-pin connector is this on my 2.5" solid state drive?

Examples of proofs by making reduction to a finite set

How do we know that black holes are spinning?

Make 1998 using the least possible digits 8

Are there any “Third Order” acronyms used in space exploration?

What makes a smart phone "kosher"?

How to give my students a straightedge instead of a ruler

'Overwrote' files, space still occupied, are they lost?

How do certain apps show new notifications when internet access is restricted to them?

How to clip and draw a picture approximately?

How to be sure services and researches offered by the University are not becoming cases of unfair competition?

How would you control supersoldiers in a late iron-age society?

How to modify this code to add more vertical space in timeline that uses Tikz

Is "you will become a subject matter expert" code for "you'll be working on your own 100% of the time"?

Exponentiation with parentheses

Planar regular languages

Add custom attribute to an external JS script

Is the Dodge action perceptible to other characters?

Unable to find solution to 6 simultaneous equations

Permutations in Disguise

Should you only use colons and periods in dialogues?

Wrong Schengen Visa exit stamp on my passport, who can I complain to?



sticky or pinned sectioned list view in android with dynamic data


How do I pass data between Activities in Android application?What is the simplest and most robust way to get the user's current location on Android?Android “Only the original thread that created a view hierarchy can touch its views.”How to create a Custom Dialog box in android?How to disable or not show any headers for StickyListHeaders from emilsjolanderHow to add sticky section headers in listview?How custom Sticky headers work in Android Listviews?How to programmatically open the Permission Screen for a specific app on Android Marshmallow?Implementing Android (no 3rd party) Listview SubheadersAndroid Import library error DefaultGroovyMavenDeveloper






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I want to achieve something like this. I am getting "survey titles"(type: string) and "different number of questions"(type:string) under every survey titles. I want to use survey titles as headers and questions of that survey should be display under that survey title header.



I have already tried https://github.com/emilsjolander/StickyListHeaders; and few other libraries. It is using first char of list data as header. Which in my case not possible.



This will be the look one header and its questions. When there are multiple survey with their questions, Sticky or pinned Header behaviour I want to achieve in my android app.










share|improve this question
























  • So you tried using a char. What about a single character string? Those libraries work.

    – Mr00Anderson
    Mar 28 at 12:27











  • @Mr00Anderson I have a complete string, I can't go with one char to decide the heading! I need a way by which I can just cover all questions of that survet title in which survey title is displayed as heading in ui.

    – andy
    Mar 28 at 13:41











  • Where the code you tried that didn't work in any library. It helps to post the samples you tried with what libraries, so others do not have to scour the internet for API references. This here looks like you can customize it more then a Char

    – Mr00Anderson
    Mar 28 at 13:46


















0















I want to achieve something like this. I am getting "survey titles"(type: string) and "different number of questions"(type:string) under every survey titles. I want to use survey titles as headers and questions of that survey should be display under that survey title header.



I have already tried https://github.com/emilsjolander/StickyListHeaders; and few other libraries. It is using first char of list data as header. Which in my case not possible.



This will be the look one header and its questions. When there are multiple survey with their questions, Sticky or pinned Header behaviour I want to achieve in my android app.










share|improve this question
























  • So you tried using a char. What about a single character string? Those libraries work.

    – Mr00Anderson
    Mar 28 at 12:27











  • @Mr00Anderson I have a complete string, I can't go with one char to decide the heading! I need a way by which I can just cover all questions of that survet title in which survey title is displayed as heading in ui.

    – andy
    Mar 28 at 13:41











  • Where the code you tried that didn't work in any library. It helps to post the samples you tried with what libraries, so others do not have to scour the internet for API references. This here looks like you can customize it more then a Char

    – Mr00Anderson
    Mar 28 at 13:46














0












0








0








I want to achieve something like this. I am getting "survey titles"(type: string) and "different number of questions"(type:string) under every survey titles. I want to use survey titles as headers and questions of that survey should be display under that survey title header.



I have already tried https://github.com/emilsjolander/StickyListHeaders; and few other libraries. It is using first char of list data as header. Which in my case not possible.



This will be the look one header and its questions. When there are multiple survey with their questions, Sticky or pinned Header behaviour I want to achieve in my android app.










share|improve this question














I want to achieve something like this. I am getting "survey titles"(type: string) and "different number of questions"(type:string) under every survey titles. I want to use survey titles as headers and questions of that survey should be display under that survey title header.



I have already tried https://github.com/emilsjolander/StickyListHeaders; and few other libraries. It is using first char of list data as header. Which in my case not possible.



This will be the look one header and its questions. When there are multiple survey with their questions, Sticky or pinned Header behaviour I want to achieve in my android app.







java android android-recyclerview android-listview listview-adapter






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 28 at 12:20









andyandy

1




1















  • So you tried using a char. What about a single character string? Those libraries work.

    – Mr00Anderson
    Mar 28 at 12:27











  • @Mr00Anderson I have a complete string, I can't go with one char to decide the heading! I need a way by which I can just cover all questions of that survet title in which survey title is displayed as heading in ui.

    – andy
    Mar 28 at 13:41











  • Where the code you tried that didn't work in any library. It helps to post the samples you tried with what libraries, so others do not have to scour the internet for API references. This here looks like you can customize it more then a Char

    – Mr00Anderson
    Mar 28 at 13:46


















  • So you tried using a char. What about a single character string? Those libraries work.

    – Mr00Anderson
    Mar 28 at 12:27











  • @Mr00Anderson I have a complete string, I can't go with one char to decide the heading! I need a way by which I can just cover all questions of that survet title in which survey title is displayed as heading in ui.

    – andy
    Mar 28 at 13:41











  • Where the code you tried that didn't work in any library. It helps to post the samples you tried with what libraries, so others do not have to scour the internet for API references. This here looks like you can customize it more then a Char

    – Mr00Anderson
    Mar 28 at 13:46

















So you tried using a char. What about a single character string? Those libraries work.

– Mr00Anderson
Mar 28 at 12:27





So you tried using a char. What about a single character string? Those libraries work.

– Mr00Anderson
Mar 28 at 12:27













@Mr00Anderson I have a complete string, I can't go with one char to decide the heading! I need a way by which I can just cover all questions of that survet title in which survey title is displayed as heading in ui.

– andy
Mar 28 at 13:41





@Mr00Anderson I have a complete string, I can't go with one char to decide the heading! I need a way by which I can just cover all questions of that survet title in which survey title is displayed as heading in ui.

– andy
Mar 28 at 13:41













Where the code you tried that didn't work in any library. It helps to post the samples you tried with what libraries, so others do not have to scour the internet for API references. This here looks like you can customize it more then a Char

– Mr00Anderson
Mar 28 at 13:46






Where the code you tried that didn't work in any library. It helps to post the samples you tried with what libraries, so others do not have to scour the internet for API references. This here looks like you can customize it more then a Char

– Mr00Anderson
Mar 28 at 13:46













1 Answer
1






active

oldest

votes


















0
















You can use the API for StickyListHeaders how you want and not use a char. I took this sample and changed a few items StickyListHeaders#getting-started indicated by my comments "//*** NOTE:" Just have to learn that you can change implementations however you want in Java if the API is provided. Just takes experimenting. Nothing in this API forces you to use their 'char' method or method at all. This is just the build in API I assume.



 @Override 
public View getHeaderView(int position, View convertView, ViewGroup parent)
HeaderViewHolder holder;
if (convertView == null)
holder = new HeaderViewHolder();
convertView = inflater.inflate(R.layout.header, parent, false);
holder.text = (TextView) convertView.findViewById(R.id.text);
convertView.setTag(holder);
else
holder = (HeaderViewHolder) convertView.getTag();

//*** NOTE: You can use the name here
//set header text as first char in name
String headerText = "" + countries[position].subSequence(0, 1).charAt(0);
holder.text.setText(headerText);
return convertView;


@Override
public long getHeaderId(int position)
//*** NOTE: You could use the hashcode of the word here or your own implementation
//return the first character of the country as ID because this is what headers are based upon
return countries[position].subSequence(0, 1).charAt(0);






share|improve this answer

























  • My ultimate goal is to achieve this: I have n number of heading list array, and all that n headers have m number of questions; I want to make n header; m questions in each header underlying them. Can you give me ultimate guide about what changes I have to made in this code? It will be a great help from your side.

    – andy
    Mar 29 at 8:02












  • So honestly their API should be enough. This is what the sites about. Giving answers to exact problems. You said you had a problem. I showed you how to complete that task using a API. You just need to experiment. That apart of being a software developer.

    – Mr00Anderson
    Mar 30 at 13:33






  • 1





    Mr00Anderson thank man. I have solved this. What I have done is I have made an object of the section as well as its questions. So that I can work with both through a one single entity.

    – andy
    Mar 31 at 14:16










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55397499%2fsticky-or-pinned-sectioned-list-view-in-android-with-dynamic-data%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0
















You can use the API for StickyListHeaders how you want and not use a char. I took this sample and changed a few items StickyListHeaders#getting-started indicated by my comments "//*** NOTE:" Just have to learn that you can change implementations however you want in Java if the API is provided. Just takes experimenting. Nothing in this API forces you to use their 'char' method or method at all. This is just the build in API I assume.



 @Override 
public View getHeaderView(int position, View convertView, ViewGroup parent)
HeaderViewHolder holder;
if (convertView == null)
holder = new HeaderViewHolder();
convertView = inflater.inflate(R.layout.header, parent, false);
holder.text = (TextView) convertView.findViewById(R.id.text);
convertView.setTag(holder);
else
holder = (HeaderViewHolder) convertView.getTag();

//*** NOTE: You can use the name here
//set header text as first char in name
String headerText = "" + countries[position].subSequence(0, 1).charAt(0);
holder.text.setText(headerText);
return convertView;


@Override
public long getHeaderId(int position)
//*** NOTE: You could use the hashcode of the word here or your own implementation
//return the first character of the country as ID because this is what headers are based upon
return countries[position].subSequence(0, 1).charAt(0);






share|improve this answer

























  • My ultimate goal is to achieve this: I have n number of heading list array, and all that n headers have m number of questions; I want to make n header; m questions in each header underlying them. Can you give me ultimate guide about what changes I have to made in this code? It will be a great help from your side.

    – andy
    Mar 29 at 8:02












  • So honestly their API should be enough. This is what the sites about. Giving answers to exact problems. You said you had a problem. I showed you how to complete that task using a API. You just need to experiment. That apart of being a software developer.

    – Mr00Anderson
    Mar 30 at 13:33






  • 1





    Mr00Anderson thank man. I have solved this. What I have done is I have made an object of the section as well as its questions. So that I can work with both through a one single entity.

    – andy
    Mar 31 at 14:16















0
















You can use the API for StickyListHeaders how you want and not use a char. I took this sample and changed a few items StickyListHeaders#getting-started indicated by my comments "//*** NOTE:" Just have to learn that you can change implementations however you want in Java if the API is provided. Just takes experimenting. Nothing in this API forces you to use their 'char' method or method at all. This is just the build in API I assume.



 @Override 
public View getHeaderView(int position, View convertView, ViewGroup parent)
HeaderViewHolder holder;
if (convertView == null)
holder = new HeaderViewHolder();
convertView = inflater.inflate(R.layout.header, parent, false);
holder.text = (TextView) convertView.findViewById(R.id.text);
convertView.setTag(holder);
else
holder = (HeaderViewHolder) convertView.getTag();

//*** NOTE: You can use the name here
//set header text as first char in name
String headerText = "" + countries[position].subSequence(0, 1).charAt(0);
holder.text.setText(headerText);
return convertView;


@Override
public long getHeaderId(int position)
//*** NOTE: You could use the hashcode of the word here or your own implementation
//return the first character of the country as ID because this is what headers are based upon
return countries[position].subSequence(0, 1).charAt(0);






share|improve this answer

























  • My ultimate goal is to achieve this: I have n number of heading list array, and all that n headers have m number of questions; I want to make n header; m questions in each header underlying them. Can you give me ultimate guide about what changes I have to made in this code? It will be a great help from your side.

    – andy
    Mar 29 at 8:02












  • So honestly their API should be enough. This is what the sites about. Giving answers to exact problems. You said you had a problem. I showed you how to complete that task using a API. You just need to experiment. That apart of being a software developer.

    – Mr00Anderson
    Mar 30 at 13:33






  • 1





    Mr00Anderson thank man. I have solved this. What I have done is I have made an object of the section as well as its questions. So that I can work with both through a one single entity.

    – andy
    Mar 31 at 14:16













0














0










0









You can use the API for StickyListHeaders how you want and not use a char. I took this sample and changed a few items StickyListHeaders#getting-started indicated by my comments "//*** NOTE:" Just have to learn that you can change implementations however you want in Java if the API is provided. Just takes experimenting. Nothing in this API forces you to use their 'char' method or method at all. This is just the build in API I assume.



 @Override 
public View getHeaderView(int position, View convertView, ViewGroup parent)
HeaderViewHolder holder;
if (convertView == null)
holder = new HeaderViewHolder();
convertView = inflater.inflate(R.layout.header, parent, false);
holder.text = (TextView) convertView.findViewById(R.id.text);
convertView.setTag(holder);
else
holder = (HeaderViewHolder) convertView.getTag();

//*** NOTE: You can use the name here
//set header text as first char in name
String headerText = "" + countries[position].subSequence(0, 1).charAt(0);
holder.text.setText(headerText);
return convertView;


@Override
public long getHeaderId(int position)
//*** NOTE: You could use the hashcode of the word here or your own implementation
//return the first character of the country as ID because this is what headers are based upon
return countries[position].subSequence(0, 1).charAt(0);






share|improve this answer













You can use the API for StickyListHeaders how you want and not use a char. I took this sample and changed a few items StickyListHeaders#getting-started indicated by my comments "//*** NOTE:" Just have to learn that you can change implementations however you want in Java if the API is provided. Just takes experimenting. Nothing in this API forces you to use their 'char' method or method at all. This is just the build in API I assume.



 @Override 
public View getHeaderView(int position, View convertView, ViewGroup parent)
HeaderViewHolder holder;
if (convertView == null)
holder = new HeaderViewHolder();
convertView = inflater.inflate(R.layout.header, parent, false);
holder.text = (TextView) convertView.findViewById(R.id.text);
convertView.setTag(holder);
else
holder = (HeaderViewHolder) convertView.getTag();

//*** NOTE: You can use the name here
//set header text as first char in name
String headerText = "" + countries[position].subSequence(0, 1).charAt(0);
holder.text.setText(headerText);
return convertView;


@Override
public long getHeaderId(int position)
//*** NOTE: You could use the hashcode of the word here or your own implementation
//return the first character of the country as ID because this is what headers are based upon
return countries[position].subSequence(0, 1).charAt(0);







share|improve this answer












share|improve this answer



share|improve this answer










answered Mar 28 at 13:49









Mr00AndersonMr00Anderson

7527 silver badges15 bronze badges




7527 silver badges15 bronze badges















  • My ultimate goal is to achieve this: I have n number of heading list array, and all that n headers have m number of questions; I want to make n header; m questions in each header underlying them. Can you give me ultimate guide about what changes I have to made in this code? It will be a great help from your side.

    – andy
    Mar 29 at 8:02












  • So honestly their API should be enough. This is what the sites about. Giving answers to exact problems. You said you had a problem. I showed you how to complete that task using a API. You just need to experiment. That apart of being a software developer.

    – Mr00Anderson
    Mar 30 at 13:33






  • 1





    Mr00Anderson thank man. I have solved this. What I have done is I have made an object of the section as well as its questions. So that I can work with both through a one single entity.

    – andy
    Mar 31 at 14:16

















  • My ultimate goal is to achieve this: I have n number of heading list array, and all that n headers have m number of questions; I want to make n header; m questions in each header underlying them. Can you give me ultimate guide about what changes I have to made in this code? It will be a great help from your side.

    – andy
    Mar 29 at 8:02












  • So honestly their API should be enough. This is what the sites about. Giving answers to exact problems. You said you had a problem. I showed you how to complete that task using a API. You just need to experiment. That apart of being a software developer.

    – Mr00Anderson
    Mar 30 at 13:33






  • 1





    Mr00Anderson thank man. I have solved this. What I have done is I have made an object of the section as well as its questions. So that I can work with both through a one single entity.

    – andy
    Mar 31 at 14:16
















My ultimate goal is to achieve this: I have n number of heading list array, and all that n headers have m number of questions; I want to make n header; m questions in each header underlying them. Can you give me ultimate guide about what changes I have to made in this code? It will be a great help from your side.

– andy
Mar 29 at 8:02






My ultimate goal is to achieve this: I have n number of heading list array, and all that n headers have m number of questions; I want to make n header; m questions in each header underlying them. Can you give me ultimate guide about what changes I have to made in this code? It will be a great help from your side.

– andy
Mar 29 at 8:02














So honestly their API should be enough. This is what the sites about. Giving answers to exact problems. You said you had a problem. I showed you how to complete that task using a API. You just need to experiment. That apart of being a software developer.

– Mr00Anderson
Mar 30 at 13:33





So honestly their API should be enough. This is what the sites about. Giving answers to exact problems. You said you had a problem. I showed you how to complete that task using a API. You just need to experiment. That apart of being a software developer.

– Mr00Anderson
Mar 30 at 13:33




1




1





Mr00Anderson thank man. I have solved this. What I have done is I have made an object of the section as well as its questions. So that I can work with both through a one single entity.

– andy
Mar 31 at 14:16





Mr00Anderson thank man. I have solved this. What I have done is I have made an object of the section as well as its questions. So that I can work with both through a one single entity.

– andy
Mar 31 at 14:16








Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.




















draft saved

draft discarded















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55397499%2fsticky-or-pinned-sectioned-list-view-in-android-with-dynamic-data%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해