From 5069dd69898bd0d9c69ba2bbd37239ec8d1c9dc6 Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Tue, 30 Sep 2014 16:06:58 -0700 Subject: Fix issue with using locally defined attrs in a shared lib The attribute name resource IDs were never fixed up with the runtime package ID so we weren't finding attributes whenever the runtime package ID was different than the build time one, which happened to be when a shared lib referenced itself (0x00 vs 0x02). Bug:17666947 Change-Id: Icf3e874bcea0e27eebe42d60fbed626a34bf9266 --- tests/SharedLibrary/lib/res/layout/main.xml | 26 ++++++++++++++++++++++ tests/SharedLibrary/lib/res/values/strings.xml | 1 + .../android/test/shared_library/ActivityMain.java | 6 +---- 3 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 tests/SharedLibrary/lib/res/layout/main.xml (limited to 'tests/SharedLibrary') diff --git a/tests/SharedLibrary/lib/res/layout/main.xml b/tests/SharedLibrary/lib/res/layout/main.xml new file mode 100644 index 0000000..df0204d9 --- /dev/null +++ b/tests/SharedLibrary/lib/res/layout/main.xml @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/tests/SharedLibrary/lib/res/values/strings.xml b/tests/SharedLibrary/lib/res/values/strings.xml index 6827f93..9beccd9 100644 --- a/tests/SharedLibrary/lib/res/values/strings.xml +++ b/tests/SharedLibrary/lib/res/values/strings.xml @@ -28,4 +28,5 @@ Racoon + This is an example of a layout this library provides. diff --git a/tests/SharedLibrary/lib/src/com/google/android/test/shared_library/ActivityMain.java b/tests/SharedLibrary/lib/src/com/google/android/test/shared_library/ActivityMain.java index 895aced..4b4893c 100644 --- a/tests/SharedLibrary/lib/src/com/google/android/test/shared_library/ActivityMain.java +++ b/tests/SharedLibrary/lib/src/com/google/android/test/shared_library/ActivityMain.java @@ -18,15 +18,11 @@ package com.google.android.test.shared_library; import android.app.Activity; import android.os.Bundle; -import android.widget.TextView; public class ActivityMain extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - - TextView content = new TextView(this); - content.setText("Dummy main entry for this apk; not really needed..."); - setContentView(content); + setContentView(R.layout.main); } } -- cgit v1.1