: Activity
.. branding agency . tree trimming . Download Winrar . .
:
1- Activity.
2- Activity .
3- Activity.
4- Activity .
Activity
.. tiffany . boston us trademarks . leon valley . .
Activity
class (HelloWorldActivity.java) src xml (main.xml) res/layout .
: 3 3 … xml .
: Activity :
HelloWorld HelloWorldActivity.java
12345678910111213 |
package com.androidhas.HelloWorld; import android.app.Activity;import android.os.Bundle; public class HelloWorldActivity extends Activity {/** Called when the activity is first created. lawn maintenance . */@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main); }} |
…
.
import .
extends Activity … Object-oriented
.
Activity .
onCreate Activity LifeCycle .
super .
setContentView ID xml
: ID R.java .
.
: object-oriented .
main.xml
123456789101112 |
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:layout_width="fill_parent"android:layout_height="fill_parent"android:orientation="vertical" > <TextViewandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:text="@string/hello" /> </LinearLayout> |
UI 10
@ strings.xml res/values .
.
Activity :
class extends Activity UI xml xml setContentView.
AndroidManifest.xml Exception.
:
<activity> <intent-filter>
12345678910111213141516171819202122 |
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"package="com.androidhas.HelloWorld"android:versionCode="1"android:versionName="1.0" > <uses-sdk android:minSdkVersion="14" /> <applicationandroid:icon="@drawable/ic_launcher"android:label="@string/app_name" ><activityandroid:name=".HelloWorldActivity"android:label="@string/app_name" ><intent-filter><action android:name="android.intent.action.MAIN" /><category android:name="android.intent.category.LAUNCHER" /></intent-filter></activity></application> </manifest> |
.
: Activity :
Activity Lifecycle .
callback .
أحدث التعليقات