Skip to content

Latest commit

 

History

History
70 lines (56 loc) · 1.46 KB

flow.md

File metadata and controls

70 lines (56 loc) · 1.46 KB

控制流程

第一个 Activity

AndroidManifest.xmlapplication 中被声明为 android.intent.category.LAUNCHERandroid.intent.action.MAIN 的 Activity。eg:

<activity android:name=".MainActivity" android:label="@string/app_name">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>

Activity 跳转

Intent intent = new Intent();
intent.setClass(this, WebViewActivity.class);
startActivity(intent);

跳转 WebViewActivity.java

Activity 关联 布局文件

protected void onCreate(Bundle savedInstanceState)  {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.webview);
}    

关联 webview.xml

Fragement 关联 布局文件

public class TitleFragment extends Fragment {
	@Override  
    public View onCreateView(LayoutInflater inflater, ViewGroup container,  
            Bundle savedInstanceState)  
    {
				View view = inflater.inflate(R.layout.list, null, false);
		}
}

TitleFragment 关联 list

android.R

int i ;
// 根据id找资源
i = android.R.id.item_id;
// 动画
i = android.R.anim.fade_in;
// 数组
i = android.R.array.emailAddressTypes;
// 颜色
i = android.R.color.darker_gray;
// 尺寸
i = android.R.dimen.app_icon_size;
// 可绘制图片
i = android.R.drawable.title_bar;
// 字符串
i = android.R.string.cancel;