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 /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)

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 /includes/functions.php on line 4362: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4364: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
anddev.org • View topic - Change date with list view

Change date with list view

Put your problem here if it does not fit any of the other categories.

Change date with list view

Postby Ipsl » Wed Dec 02, 2009 3:15 am

Let me first say that I'm a complete beginner with all things involving code. So bare with me.

I'm trying to have a list (that will eventually be excerpts from a webpage) and when I run it I get ActivityManager: - exec '/system/bin/sh' failed: Bad address (14) -

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public class PageTwo extends ListActivity {
  2.  
  3.        
  4.  
  5.            private TextView mDateDisplay;
  6.  
  7.             private Button mPickDate;
  8.  
  9.            
  10.  
  11.             private int mYear;
  12.  
  13.             private int mMonth;
  14.  
  15.             private int mDay;
  16.  
  17.  
  18.  
  19.             static final int DATE_DIALOG_ID = 0;
  20.  
  21.  
  22.  
  23.             @Override
  24.  
  25.             protected Dialog onCreateDialog(int id) {
  26.  
  27.                 switch (id) {
  28.  
  29.                 case DATE_DIALOG_ID:
  30.  
  31.                     return new DatePickerDialog(this,
  32.  
  33.                                 mDateSetListener,
  34.  
  35.                                 mYear, mMonth, mDay);
  36.  
  37.                 }
  38.  
  39.                 return null;
  40.  
  41.             }
  42.  
  43.            
  44.  
  45.             public void onCreate1(Bundle savedInstanceState) {
  46.  
  47.               super.onCreate(savedInstanceState);
  48.  
  49.              
  50.  
  51.               setListAdapter(new ArrayAdapter<String>(this,
  52.  
  53.                       android.R.layout.simple_list_item_1, WEBLIST));
  54.  
  55.               getListView().setTextFilterEnabled(true);
  56.  
  57.             }      
  58.  
  59.            
  60.  
  61.             static final String[] WEBLIST = new String[] {
  62.  
  63.                 "Example", "Example1", "Example3",
  64.  
  65.  
  66.  
  67.               };
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.            
  78.  
  79.             // the callback received when the user "sets" the date in the dialog
  80.  
  81.             private DatePickerDialog.OnDateSetListener mDateSetListener =
  82.  
  83.                     new DatePickerDialog.OnDateSetListener() {
  84.  
  85.  
  86.  
  87.                         public void onDateSet(DatePicker view, int year,
  88.  
  89.                                               int monthOfYear, int dayOfMonth) {
  90.  
  91.                             mYear = year;
  92.  
  93.                             mMonth = monthOfYear;
  94.  
  95.                             mDay = dayOfMonth;
  96.  
  97.                             updateDisplay();
  98.  
  99.                         }
  100.  
  101.                     };
  102.  
  103.            
  104.  
  105.             // updates the date we display in the TextView
  106.  
  107.             private void updateDisplay() {
  108.  
  109.                 mDateDisplay.setText(
  110.  
  111.                     new StringBuilder()
  112.  
  113.                             // Month is 0 based so add 1
  114.  
  115.                             .append(mMonth + 1).append("-")
  116.  
  117.                             .append(mDay).append("-")
  118.  
  119.                             .append(mYear).append(" "));
  120.  
  121.             }
  122.  
  123.            
  124.  
  125.             protected void onCreate(Bundle savedInstanceState) {
  126.  
  127.                 super.onCreate(savedInstanceState);
  128.  
  129.                 setContentView(R.layout.main);
  130.  
  131.  
  132.  
  133.                 // capture our View elements
  134.  
  135.                 mDateDisplay = (TextView) findViewById(R.id.dateDisplay);
  136.  
  137.                 mPickDate = (Button) findViewById(R.id.pickDate);
  138.  
  139.  
  140.  
  141.                 // add a click listener to the button
  142.  
  143.                 mPickDate.setOnClickListener(new View.OnClickListener() {
  144.  
  145.                     public void onClick(View v) {
  146.  
  147.                         showDialog(DATE_DIALOG_ID);
  148.  
  149.                     }
  150.  
  151.                 });
  152.  
  153.  
  154.  
  155.                 // get the current date
  156.  
  157.                 final Calendar c = Calendar.getInstance();
  158.  
  159.                 mYear = c.get(Calendar.YEAR);
  160.  
  161.                 mMonth = c.get(Calendar.MONTH);
  162.  
  163.                 mDay = c.get(Calendar.DAY_OF_MONTH);
  164.  
  165.  
  166.  
  167.                 // display the current date
  168.  
  169.                 updateDisplay();
  170.  
  171.             }
  172.  
  173.            
  174.  
  175. }
  176.  
  177.  
Parsed in 0.015 seconds, using GeSHi 1.0.8.4


and

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <?xml version="1.0" encoding="utf-8"?>
  3.  
  4. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  5.  
  6.    android:layout_width="wrap_content"
  7.  
  8.    android:layout_height="wrap_content"
  9.  
  10.    android:orientation="vertical">
  11.  
  12.  
  13.  
  14.     <TextView android:id="@+id/dateDisplay"
  15.  
  16.            android:layout_width="wrap_content"
  17.  
  18.            android:layout_height="wrap_content"
  19.  
  20.            android:text=""/>
  21.  
  22.  
  23.  
  24.     <Button android:id="@+id/pickDate"
  25.  
  26.            android:layout_width="wrap_content"
  27.  
  28.            android:layout_height="wrap_content"
  29.  
  30.            android:layout_alignParentRight="true"
  31.  
  32.            android:layout_alignParentTop="true"
  33.  
  34.            android:text="Change the date"/>
  35.  
  36.            
  37.  
  38.         <ListView android:id="@+id/list"
  39.  
  40.                 android:layout_width="wrap_content"
  41.  
  42.                 android:layout_height="wrap_content"
  43.  
  44.                 android:layout_below="@id/pickDate"/>
  45.  
  46.  
  47.  
  48. </RelativeLayout>
  49.  
  50.  
  51.  
  52.  
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


Thank you in advance for reading this. I tried searching around and from that I got it to install so I have tried to not post. :)
Ipsl
Once Poster
Once Poster
 
Posts: 1
Joined: Tue Dec 01, 2009 5:31 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 12 guests