Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
package my.twoarray; import java.util.ArrayList; import java.util.HashMap; import android.app.Activity; import android.app.ListActivity; import android.os.Bundle; import android.widget.ArrayAdapter; import android.widget.SimpleAdapter; import android.widget.Toast; public class TwoArray extends ListActivity { //********************************************************************** // NOTE: You CAN make this work for three or more arrays, but I'm not // sure if it's because of a bug or oversight in the definition of // HashMaps or not. // // Typically HashMaps and Maps only let you use a single // key and value combo (you can't do or or the like). // The ArrayList is a one-dimensional deal. // // HOWEVER: Oddly, I was able to use the "put" method of HashMap to // superload it with a third hash key that the list amazingly recognized. // So it can work, but with some care. //********************************************************************** // Declare what connects the first two parallel arrays // (Note: for the third, fourth, etc. arrays, don't worry about this; // see below.) ArrayList> list = new ArrayList>(); // Define a simple adapter SimpleAdapter adapEntries; // Define your arrays (minimum of 2, but you can use 3 or more) private String[] cities; private String[] states; private String[] areacodes; @Override public void onCreate(Bundle savedInstanceState) { Integer n; super.onCreate(savedInstanceState); setContentView(R.layout.main); // Get the arrays locally cities = this.getResources().getStringArray(R.array.cities); states = this.getResources().getStringArray(R.array.states); areacodes = this.getResources().getStringArray(R.array.areacodes); // Add them to the HashMap for (n = 0; n < cities.length; n++) { AddEntry(cities[n], states[n], areacodes[n]); } RefreshList(); } public void AddEntry(String cityarg, String statearg, String areacodearg) { // Add a local array entry to the ArrayAdapter using a // new, ad hoc HashMap. Note that the keys are not equal // to the control names in the XML layout. // WATCH THIS CODE in the future; this may be a bug or it may not // be. If using "put" more than twice causes weird activity, // and Google corrects it, this may stop working for the third and // later arguments. HashMap newitem = new HashMap(); newitem.put( "city", cityarg ); newitem.put( "state", statearg ); newitem.put( "areacode", areacodearg ); list.add( newitem ); // "list" is defined globally; see above } public void RefreshList() { // NOTE: the key names below MUST match the names in the "put" // statement in the routine above, element for element (if there // are three key names above, there must be three key names below). SimpleAdapter adapEntries = new SimpleAdapter( this, list, R.layout.threeline, new String[] { "city", "state", "areacode" }, new int[] { R.id.txtCity, R.id.txtState, R.id.txtAreaCode } ); setListAdapter(adapEntries); } }