this my code
Using java Syntax Highlighting
- package com.simetex;
- import android.app.Activity;
- import android.os.Bundle;
- import android.widget.TextView;
- import android.app.DatePickerDialog;
- import android.widget.DatePicker;
- import android.widget.TimePicker;
- import android.app.TimePickerDialog;
- import android.widget.Button;
- import android.view.View;
- import java.util.Calendar;
- public class MyThirdAndroid extends Activity {
- /** Called when the activity is first created. */
- private TextView tvDisplay;
- private int mYears;
- private int mMonths;
- private int mDates;
- private int mHours;
- private int mMinute;
- @Override
- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.main);
- tvDisplay = (TextView) findViewById(R.id.display);
- Button pickTime = (Button) findViewById(R.id.pickTime);
- pickTime.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- new DatePickerDialog(MyThirdAndroid.this, mDateListener,
- mYears, mMonths, mDates, Calendar.SUNDAY).show();
- }
- });
- Button pickDate = (Button) findViewById(R.id.pickDate);
- pickDate.setOnClickListener(new View.OnClickListener() {
- public void onClick(View v) {
- new TimePickerDialog(MyThirdAndroid.this, mTimeListener,
- "setTime", mHours, mMinute, false).show();
- }
- });
- final Calendar c = Calendar.getInstance();
- mYears = c.get(Calendar.YEAR);
- mMonths = c.get(Calendar.MONTH);
- mDates = c.get(Calendar.DAY_OF_MONTH);
- mHours = c.get(Calendar.HOUR_OF_DAY);
- mMinute = c.get(Calendar.MINUTE);
- updateDisplay();
- }
- private void updateDisplay() {
- tvDisplay.setText(new StringBuilder().append(mMonths).append("-")
- .append(mDates).append("-").append(mYears).append("").append(
- pad(mHours)).append(":").append(pad(mMinute)));
- }
- private DatePicker.OnDateSetListener mDateListener = new DatePicker.OnDateSetListener() {
- public void dateSet(DatePicker view, int yearx, int monthOfYear,
- int dateOfMonth) {
- mYears = yearx;
- mMonths = monthOfYear;
- mDates = dateOfMonth;
- updateDisplay();
- }
- };
- private TimePicker.OnTimeSetListener mTimeListener = new TimePicker.OnTimeSetListener() {
- public void timeSet(TimePicker view, int hoursx, int minutex) {
- mHours = hoursx;
- mMinute = minutex;
- updateDisplay();
- }
- };
- private static String pad(int c) {
- if (c > 10) {
- return String.valueOf(c);
- } else {
- return "0".concat(String.valueOf(c));
- }
- }
- }
Parsed in 0.140 seconds, using GeSHi 1.0.8.4
this main.xml
Using xml Syntax Highlighting
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:orientation="vertical" android:layout_width="fill_parent"
- android:layout_height="fill_parent">
- <LinearLayout android:layout_width="wrap_content"
- android:layout_height="wrap_content">
- <TextView android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Hello World, MyThirdAndroid" id="@+id/display" />
- </LinearLayout>
- <Button android:layout_width="wrap_content"
- android:layout_height="wrap_content" id="@+id/pickTime" />
- <Button android:layout_width="wrap_content"
- android:layout_height="wrap_content" id="@+id/pickDate" />
- </LinearLayout>
Parsed in 0.003 seconds, using GeSHi 1.0.8.4
[2550-11-19 22:29:32 - MyThirdAndroid] ActivityManager: Starting: Intent { comp={com.simetex/com.simetex.MyThirdAndroid} }
[2550-11-19 22:29:32 - MyThirdAndroid] ActivityManager: Error: Activity class {com.simetex/com.simetex.MyThirdAndroid} does not exist.
please advice me .
I'm new guy.

(changed it already)



