diff options
author | Bob Badour <bbadour@google.com> | 2020-05-06 15:09:12 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-05-06 15:09:12 +0000 |
commit | f1a59c98333d28b04b74772f204bcc1df6e83634 (patch) | |
tree | fd845444b59dfc72656b7781596e0b1a0662c4c7 /testapps/libsTest/lib1/src/com/android/tests/libstest/lib1/Lib1.java | |
parent | 14a008655dafe4ca1fc7d014a16a1c401761675c (diff) | |
parent | d58f8ba3b1869530926bd5f167103dfa161787a1 (diff) | |
download | sdk-f1a59c98333d28b04b74772f204bcc1df6e83634.tar.gz |
Merge "Revert "Remove unused project."" am: fc7cda06f5 am: d3c69fa48e am: d58f8ba3b1
Change-Id: I297730ce4f9da2bf30dde696439ab825cd642b00
Diffstat (limited to 'testapps/libsTest/lib1/src/com/android/tests/libstest/lib1/Lib1.java')
-rw-r--r-- | testapps/libsTest/lib1/src/com/android/tests/libstest/lib1/Lib1.java | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/testapps/libsTest/lib1/src/com/android/tests/libstest/lib1/Lib1.java b/testapps/libsTest/lib1/src/com/android/tests/libstest/lib1/Lib1.java new file mode 100644 index 000000000..c62bec228 --- /dev/null +++ b/testapps/libsTest/lib1/src/com/android/tests/libstest/lib1/Lib1.java @@ -0,0 +1,43 @@ +package com.android.tests.libstest.lib1; + +import android.app.Activity; +import android.widget.TextView; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; + +public class Lib1 { + + public static void handleTextView(Activity a) { + TextView tv = (TextView) a.findViewById(R.id.lib1_text2); + if (tv != null) { + tv.setText(Lib1.getContent()); + } + } + + public static String getContent() { + InputStream input = Lib1.class.getResourceAsStream("Lib1.txt"); + if (input == null) { + return "FAILED TO FIND Lib1.txt"; + } + + BufferedReader reader = null; + try { + reader = new BufferedReader(new InputStreamReader(input, "UTF-8")); + + return reader.readLine(); + } catch (IOException e) { + } finally { + if (reader != null) { + try { + reader.close(); + } catch (IOException e) { + } + } + } + + return "FAILED TO READ CONTENT"; + } +} |