前言:
今天是10月10日,又称十全十美日。
其实,
工作没有十全十美,尽心就好;
生活没有十全十美,简单就好;
朋友没有十全十美,真诚就好;
爱人没有十全十美,真心就好;
亲人没有十全十美,和睦就好;
幸福没有十全十美,知足就好;
人生没有十全十美,快乐就好!.
所以,
我决定从今天开始每天更新一篇安卓学习笔记源码。
package com.itarchy.demo;
import android.app.Activity;
import android.os.Bundle;
public class MyActivity extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
}
}
package com.itarchy.demo;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
public class HomeActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
System.out.println("onCreate");
Log.d("TAG", "---HomeActivity--->onCreate");
Log.i("Hello", "---HomeActivity--->onCreate");
// Uri uri = Uri.parse("tel:13720012564");
// Intent it = new Intent(Intent.ACTION_VIEW, uri);
// it.putExtra("sms_body", "The SMS text");
// it.setType("vnd.android-dir/mms-sms");
// startActivity(it);
Intent intent = new Intent();
intent.setAction(Intent.ACTION_DIAL);
//ACTION_DIAL ACTION_CALL
Uri uri = Uri.parse("tel:13720012564");
intent.setData(uri);
startActivity(intent);
//startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.baidu.com")));
}
@Override
protected void onStart() {
super.onStart();
Log.d("TAG", "---HomeActivity--->onStart");
}
@Override
protected void onResume() {
super.onResume();
Log.d("TAG", "---HomeActivity--->onResume");
}
@Override
protected void onPause() {
super.onPause();
Log.d("TAG", "---HomeActivity--->onPause");
}
@Override
protected void onStop() {
super.onStop();
Log.d("TAG", "---HomeActivity--->onStop");
}
@Override
protected void onDestroy() {
super.onDestroy();
Log.d("TAG", "---HomeActivity--->onDestroy");
}
@Override
protected void onRestart() {
super.onRestart();
Log.d("TAG", "---HomeActivity--->onRestart");
}
}
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".HomeActivity" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ni hao" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="center" />
</RelativeLayout>
package com.itarchy.demo;
import android.app.Activity;
import android.os.Bundle;
public class MyClass extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
}
}
package com.itarchy.demo;
import android.app.Activity;
import android.os.Bundle;
public class NewActivity extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
protected void onStart() {
super.onStart();
}
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.itarchy.demo"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="@drawable/qq_ph"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity android:name="com.itarchy.demo.MyActivity" >
</activity>
<activity android:name="com.itarchy.demo.HomeActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>