Skip to content

Instantly share code, notes, and snippets.

@edenizk
Last active May 11, 2018 17:22
Show Gist options
  • Save edenizk/e3aa35e534af918717448c8d08c125f0 to your computer and use it in GitHub Desktop.
Save edenizk/e3aa35e534af918717448c8d08c125f0 to your computer and use it in GitHub Desktop.
prints array list
package com.example.deniz.arraylist;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;
import org.w3c.dom.Text;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView txtValue = (TextView) findViewById(R.id.txtValue);
TextView txtIndex = (TextView) findViewById(R.id.txtIndex);
String oldValue;
String oldIndex;
int[] intArray = new int[10];
for (int i = 0 ; i < intArray.length ; i++){
oldIndex = txtIndex.getText().toString();
oldValue = txtValue.getText().toString();
txtValue.setText(oldValue + i + "\n");
txtIndex.setText(oldIndex + i + "\n");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment