
Untitled
By: a guest on
Jun 17th, 2012 | syntax:
None | size: 0.95 KB | hits: 21 | expires: Never
Android: Split function not working
package com.example.splitfunction;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class SplitFunction extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
String url = "http://mysub.somedomain.com/tabletcms/tablets/youcontent/000002/thumbnails/110/png";
String[] values;
int x = 0;
tv.setText("SPLIT FUNCTION PROGRAM...n");
tv.append(url);
values = url.split("/");
while( x < values.length ){
tv.append("n" + x + ":> " + values[x]);
x++;
}
setContentView(tv);
}
}
tv.append("n" + x + ":> " + values[x++]);
while( x < values.length ){
tv.append("n" + x + ":> " + values[x]);
x++
}