Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
still prob is it is not printed on textview
I'm using 2 file 1 to get data that i'm pass'n to another as
x.java
in.putExtra("ss", fs); where fs is an integer array
y.java
int yy [] = getIntent().getExtras().getIntArray("ss");
String sop="hi";
StringBuilder sb=new StringBuilder();
for(int i: yy){
sb.append(Integer.toString(i));
}
String str = sop+sb.toString();
tv.setText(str);//where tv is textview which is visible i have checked
)
As far as I can tell the Integer class does not have a toString method with 0 parameters, so I would be surprised if that compiled.
The parameter is "i", an integer. One problem here is that shredcode's example has a mistake. It should be: sb.append(Integer.toString(yy)); and not sb.append(Integer.toString(i));
Otherwise, this it will just print the integers 0,1,2.. instead of the actual integers contained in yy[]. Also, there are no delimiters in the code, so they will also just print 012.. with no spaces. Can the OP specify how he wants it formatted?
Indeed this is correct, I dont know why I read the dev forums when sleepyI do want to point out the difference and confusion I think you are having with the different 'for' loop options in java.
Java 5 brought about the 'for each' method:
for(int i : intArray){
//some code
}

Yeah that's what I asked earlier -- I'm not sure if the OP said 'hi' doesn't show, though.Since 'hi' did not show in the textView, it lets us know it is a view setup issue and not a loop issue.
The parameter is "i", an integer. One problem here is that shredcode's example has a mistake. It should be: sb.append(Integer.toString(yy)); and not sb.append(Integer.toString(i));
Otherwise, this it will just print the integers 0,1,2.. instead of the actual integers contained in yy[]. Also, there are no delimiters in the code, so they will also just print 012.. with no spaces. Can the OP specify how he wants it formatted?
