I am trying to get the total messages value from second Activity's list. I have implemented this. But it always shows the value of 0 or null in case of String. Can anyone tell me how can I get the ArrayList size in my first Activity.
My code is,
In second activity:
private static List<String> msgList = new ArrayList<String>();//above oncreate method
setMsgList(getSMS());//call the method
int count = getMsgList().size();
msgcount = String.valueOf(count);
System.out.println("listcount" + msgcount);//it prints the correct list size
And my first Activity is,
String size=InboxActivity.msgcount;
System.out.println("count:::::::::::::"+size);//it prints 0
Can anyone tell me how can I get the list count in first Activity?