Keep screen on

This commit is contained in:
Tad 2017-12-14 16:15:37 -05:00
parent 8e4b5328bd
commit 891f19f37c
2 changed files with 4 additions and 1 deletions

2
.idea/misc.xml generated
View file

@ -24,7 +24,7 @@
</value> </value>
</option> </option>
</component> </component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK"> <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">

View file

@ -8,6 +8,7 @@ import android.text.method.ScrollingMovementMethod;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.WindowManager;
import android.widget.TextView; import android.widget.TextView;
public class MainActivity extends AppCompatActivity { public class MainActivity extends AppCompatActivity {
@ -24,6 +25,8 @@ public class MainActivity extends AppCompatActivity {
Toolbar toolbar = findViewById(R.id.toolbar); Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
TextView logView = findViewById(R.id.txtLogOutput); TextView logView = findViewById(R.id.txtLogOutput);
logView.setMovementMethod(new ScrollingMovementMethod()); logView.setMovementMethod(new ScrollingMovementMethod());
logView.append("Copyright 2017 Spot Communications, Inc.\n"); logView.append("Copyright 2017 Spot Communications, Inc.\n");