Skip to content

Commit

Permalink
Move ConsoleActivity call of Python.getInstance to onCreate, so it's …
Browse files Browse the repository at this point in the history
…usable without PyApplication (chaquo/chaquopy-hello#2)
  • Loading branch information
Malcolm Smith committed Dec 29, 2017
1 parent f1eba0d commit 9ed64a4
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
import com.chaquo.python.*;
import java.util.*;

public class ConsoleActivity extends AppCompatActivity {
public abstract class ConsoleActivity extends AppCompatActivity {

protected Python py = Python.getInstance();
protected Python py;
protected ScrollView svBuffer;
protected TextView tvBuffer;

Expand All @@ -26,6 +26,7 @@ protected static class State {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
py = Python.getInstance();
svBuffer = (ScrollView) findViewById(R.id.svBuffer);
tvBuffer = (TextView) findViewById(R.id.tvBuffer);
if (Build.VERSION.SDK_INT >= 23) {
Expand Down

0 comments on commit 9ed64a4

Please sign in to comment.