public class MainActivity extends Activity {


TextView tID;
TextView tName;
TextView tWorld;

protected void onCreate(Bundle paramBundle) {
    super.onCreate(paramBundle);
    setContentView(R.layout.ps);


    tID = (TextView) findViewById(R.id.tID);
    tName = (TextView) findViewById(R.id.tName);
    tWorld = (TextView) findViewById(R.id.tWorld);
}

public void Search(View view) {

    int clist = -2;
    String oID = "";
    String oName = "";
    String oWorld = "";
    setContentView(R.layout.list);
    while (clist != -1)
    {
        oID = tID.getText().toString();
        tID.setText(oID+"ddf"+"\n");
        oName = tName.getText().toString();
        clist = -1;
    }

}
}

list.xml

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/VScroll"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:weightSum="3" >

    <TextView
        android:id="@+id/tID"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:gravity="center"
        android:text=" " />

    <TextView
        android:id="@+id/tName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:gravity="center"
        android:text=" " />

    <TextView
        android:id="@+id/tWorld"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:gravity="center"
        android:text=" " />

</LinearLayout>

</ScrollView>

I know this is probably really simple but looking online doesn't answer it... why does this crash upon getting to here?: I know this is probably really simple but looking online doesn't answer it... why does this crash upon getting to here?:

while (clist != -1)
    {
        oID = tID.getText().toString();
        tID.setText(oID+"ddf"+"\n");
        oName = tName.getText().toString();
        clist = -1;
    }

Related posts

Recent Viewed