What is different between @+id/android:list and @id/android:list?

前端 未结 4 2119
别跟我提以往
别跟我提以往 2020-12-16 23:26

I\'ve develop android application, and one question.

As you know, When we use LiveActivity, we must specify @id/android:list for ListView ID.

But, When I us

4条回答
  •  我在风中等你
    2020-12-16 23:36

    Resource IDs in Android are specific to a package (which is good, or else you'd have lots of conflicts if your app is dealing with several packages at the same time).

    @+id/list will create a resource ID in your app (=your package) with the name "list" and give it a unique ID. In code, that would be R.id.list.

    @android:id/list will use the ID "list" from the package android (which, in code, would be android.R.id.list.

提交回复
热议问题