Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>had an epiphany over the weekend about how to fix this problem and i finally found a good work around for my app.. i know it isnt optimal because i hard coded the number 100 into it but for my uses as of now i know i wont ever have that many list items..</p> <p>i added these 2 bits of code to my alertsadapter class</p> <pre><code>int startzero = 0; public static String[][] promomatrix = new String[6][100]; </code></pre> <p>and</p> <p>promomatrix[0][startzero] = al.cityid; promomatrix[1][startzero] = al.promoterid; promomatrix[2][startzero] = al.promocontent; promomatrix[3][startzero] = al.promotitle; promomatrix[4][startzero] = al.locationid; promomatrix[5][startzero] = al.cover;</p> <pre><code> startzero++; </code></pre> <p>then went to my homepageactivity class and added this to the click listener</p> <pre><code>Intent intent = new Intent( HomePageActivity.this,PromotionActivity.class); intent.putExtra("listitemcity", AlertsAdapter.promomatrix[0][pos]); intent.putExtra("listitempromoter", AlertsAdapter.promomatrix[1][pos]); intent.putExtra("listitemcontent", AlertsAdapter.promomatrix[2][pos]); intent.putExtra("listitemtitle", AlertsAdapter.promomatrix[3][pos]); intent.putExtra("listitemlocation", AlertsAdapter.promomatrix[4][pos]); intent.putExtra("listitemcover", AlertsAdapter.promomatrix[5][pos]); finish(); startActivity(intent); </code></pre> <p>and finally went to my promotionactivity (where i was trying to send the strings) and added this</p> <pre><code>Bundle extras = getIntent().getExtras(); if (extras == null){ return; } String listitemcity = extras.getString("listitemcity"); String listitempromoter = extras.getString("listitempromoter"); String listitemcontent = extras.getString("listitemcontent"); String listitemtitle = extras.getString("listitemtitle"); String listitemlocation = extras.getString("listitemlocation"); String listitemcover = extras.getString("listitemcover"); </code></pre> <p>worked like a charm.. i hope this helps someone :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload