I have a native Android news App where I have news articles and comments under each article.
When I open the inner View(Activity) of any specific article there might be different coverages of the same article, e.g. the Coverage from CNN, BBC, FOX ...etc.
Each coverage is actually treated as a different article with Unique String ID/Hash.
My background is Perl/PHP I'd like to know how do I create something like this in java:
$array["Article1_Coverage_X"] = array($Comment1,$Comment2,$Comment3);
$array["Article1_Coverage_Y"] = array($Comment1,$Comment2,$Comment3,$Comment4);
// $Comment1 , $Comment2 ....etc are comment objects
. . i.e. the first dimension of the array is a string(key) and the 2nd dimension is of other type
I tried the following but it's not what I'm looking for:
ArrayList<ArrayList<Comment>> // Where Comment is a Java object with ID,Title.....etc
As the keys for both dimension are indexed integers
if there's a better approach I'd highly appreciate it. I want to store the list of comments related to each news article in a temporary variable such that it's (recycled/thrown to garbage) once the user quits the Activity, that's why I don't wanna store in an SQLite db.