Skip to content

Commit 3674c65

Browse files
committed
Refactor WebView & AlertDialog.Builder as local variables
1 parent 73506c1 commit 3674c65

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

app/src/main/java/io/github/yawnoc/strokeinput/MainActivity.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ public class MainActivity
2525
extends AppCompatActivity
2626
implements View.OnClickListener
2727
{
28-
private AlertDialog.Builder htmlAlertDialogBuilder;
29-
private WebView htmlWebView;
30-
3128
public static final String SOURCE_CODE_URL =
3229
"https://github.com/stroke-input/stroke-input-android";
3330
public static final String ABOUT_URI =
@@ -57,9 +54,10 @@ public void onClick(final View view) {
5754
startActivity(sourceCodeIntent);
5855
}
5956
else if (viewId == R.id.about_button) {
60-
htmlWebView = new WebView(this);
57+
final WebView htmlWebView = new WebView(this);
6158
htmlWebView.loadUrl(ABOUT_URI);
62-
htmlAlertDialogBuilder = new AlertDialog.Builder(this);
59+
final AlertDialog.Builder htmlAlertDialogBuilder =
60+
new AlertDialog.Builder(this);
6361
htmlAlertDialogBuilder
6462
.setView(htmlWebView)
6563
.setPositiveButton(R.string.activity_main_return_label, null)

0 commit comments

Comments
 (0)