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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -