java - How to use String array in another activity -


i have 2 activities. each extends activity. tried ways found here, none of them working. need send string array 1 other activity, stay in first activity. try this:

intent intent = new intent(activityfrom.this, activityto.class);                                                 intent.putextra("string-array", array);                                                 activityfrom.this.startactivity(intent);  

and recive:

 intent intent = getintent();         string[] array = intent.getextras().getstringarray("string-array"); 

any idea?

bundle b=new bundle(); b.putstringarray("key", strarray); intent intent=new intent(this, nextactivity.class); intent.putextras(b); startactivity(intent); 

Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -