Hi I get a null point exception with the following code can anyone
help ?
I want to go through my array items and print each item to the user
using a toast message
Thanks
Graham
package gb.org;
import java.util.Arrays;
import java.util.ArrayList;
import android.widget.Toast;
import android.app.Activity;
//I need an activity for my toast to work correctly
public class ExtractContacts extends Activity{
ArrayList<String> items=new ArrayList<String>();
public void addToArray(String contactToBlock) {
//add a number to items
contactToBlock.toString();
items.add(contactToBlock);
String Temp;
for (int i =0;i<items.size();i++){
System.out.println(items.get(i));
Toast.makeText(this, "Hello world " + items.get(i),
Toast.LENGTH_LONG).show();
}
}
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en