Category Archives: Shell

Android coding log

初始化一个Button

Button btn = (Button) findViewById(R.id.button);
btn.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            /* action here*/
        }
});

setOnClickListener Method传递一个OnClickListener Interface Object. 从而Interface的OnClick方法被调用.

Kotlin的{} curly braces 可以是一个匿名函数Anonymous functions , shell 里面叫group command .

Java 子类不能override 父类没有定义的method.

The Activity class is a crucial component of an Android app, and the way activities are launched and put together is a fundamental part of the platform’s application model. Unlike programming paradigms in which apps are launched with a main() method, the Android system initiates code in an Activity instance by invoking specific callback methods that correspond to specific stages of its lifecycle.

A Fragment represents a behavior or a portion of user interface in a FragmentActivity. You can combine multiple fragments in a single activity to build a multi-pane UI and reuse a fragment in multiple activities. You can think of a fragment as a modular section of an activity, which has its own lifecycle, receives its own input events, and which you can add or remove while the activity is running (sort of like a “sub activity” that you can reuse in different activities).

Shell 脚本链接

https://github.com/LineageOS/android_device_xiaomi_mido/blob/lineage-15.1/extract-files.sh

https://github.com/LineageOS/android_device_xiaomi_msm8953-common/blob/lineage-15.1/extract-files.sh

https://github.com/LineageOS/android_vendor_lineage/blob/lineage-15.1/build/tools/extract_utils.sh

https://github.com/LineageOS/android_device_xiaomi_mido/blob/lineage-15.1/proprietary-files.txt