android - Sending parameter values via intent -
i want access same class according number of user requests. i've tried following this tutorial use putextra, example 2 different classes, whereas need intent call same class.
here codes :
string datax="datax"; int count; while(count >0){ count--; startactivity(m_insertdata.this, m_insertdata.class); intent toalternative = new intent(m_insertdata.this, m_insertdata.class); toalternative.putextra(datax, count); } thankyou before :)
when call startactivity(m_insertdata.this, m_insertdata.class); doing casting 2 params intent , calling start activity on it. create intent , add data never use anything. instead, last 3 lines in while loop should read
intent toalternative = new intent(m_insertdata.this, m_insertdata.class); toalternative.putextra(datax, count); startactivity(toalternative); that should pass data (via intent) new activity.
Comments
Post a Comment