Skip to content

Commit

Permalink
Need to run this conditionally because we support Android H and this …
Browse files Browse the repository at this point in the history
…requires Android N
  • Loading branch information
justdave committed May 31, 2020
1 parent 8cfba6e commit 4eb8345
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/main/java/net/justdave/mcstatus/AboutDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import android.os.Build;
import android.os.Bundle;
import android.text.Html;
import android.text.util.Linkify;
Expand All @@ -35,7 +36,11 @@ public void onCreate(Bundle savedInstanceState) {
String version = "???";
int vCode = 0;
TextView tv = findViewById(R.id.info_text);
tv.setText(Html.fromHtml(readRawTextFile(R.raw.about_info), Html.FROM_HTML_MODE_LEGACY));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
tv.setText(Html.fromHtml(readRawTextFile(R.raw.about_info), Html.FROM_HTML_MODE_LEGACY));
} else {
tv.setText(Html.fromHtml(readRawTextFile(R.raw.about_info)));
}
tv.setLinkTextColor(Color.BLUE);
Linkify.addLinks(tv, Linkify.ALL);
TextView ver = findViewById(R.id.version_string);
Expand Down

0 comments on commit 4eb8345

Please sign in to comment.