Skip to content

Commit

Permalink
Testing on older Android 4.2 tablet revealed that onClick in XML not …
Browse files Browse the repository at this point in the history
…working correctly. Code revised to set onClick listneers in OnCreate of Activity
  • Loading branch information
WakeRealityDev committed Mar 11, 2017
1 parent 1bd794a commit 0d301fc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ android {
minSdkVersion 15
targetSdkVersion 25

versionCode 11
versionName "0.4.11"
versionCode 12
versionName "0.4.12"

signingConfig signingConfigs.WakeReality_androidB
}
Expand Down
14 changes: 14 additions & 0 deletions app/src/main/java/com/yrek/incant/Incant.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,20 @@ public void onCreate(Bundle savedInstanceState) {

coverImageCache = new LruCache<String,Bitmap>(10);

findViewById(R.id.main_top_intro_button_label0).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
hideIntroMessageClick(v);
}
});

findViewById(R.id.main_top_error_storage_try).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
storageTryAgainClick(v);
}
});

if (useStyledIntroStrings) {
// Android does not seem to have a way to getText() directly from XML, so try here in code.
((TextView) findViewById(R.id.main_top_intro_title0)).setText(getText(R.string.main_intro_title0_styled));
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/res/layout/main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
android:layout_height="wrap_content"
android:padding="6dp"
android:text="@string/main_intro_button_label0"
android:onClick="hideIntroMessageClick"
/>
</LinearLayout>

Expand All @@ -63,7 +62,6 @@
android:layout_height="wrap_content"
android:padding="6dp"
android:text="@string/main_top_error_storage_try"
android:onClick="storageTryAgainClick"
/>
</LinearLayout>

Expand Down

0 comments on commit 0d301fc

Please sign in to comment.