javaandroidtextviewpopupwindow

How to display bullet points with variable length in Android that are underneath each other


I would like to add a list with bullet points with variable size (line numbers) in an Android popup window (with Java) such that the bullets starts directly underneath each other. For example I have the list

The bullet points come from a database query. Now how can I implement this? I thought about using a textView for every bullet point. The bullet points are the columns of a database query (so I have multiple columns per row with the text; each of them has 1 bullet point). The problem is that if I specify the textView in the XML layout file, I can't know in advance how many line it should cover and thus I can't position the textViews correctly.

Another approach might be to just use 1 column in the database for all bullets but use some formatting symbols in the string and try to build the string using the formatting symbols just in 1 TextView. As I have no experience with such a approach I just wanted to ask you, what other ways (possibly more convenient) exist to do something like this?

I'd appreciate every comment and would be thankful for your advice.


Solution

  • Maybe I dont understand 100% what situation you're trying to describe, I dont know why you stored bullet in your database? However, if you want to build the bullet points with texts dynamically, you can refer to this article for more information